Hotel Script Fivem Apr 2026
if removeMoney(src, price) then local paidUntil = os.time() + (Config.PaymentInterval * 60) MySQL.insert('INSERT INTO hotel_rentals (citizenid, room_number, paid_until) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE paid_until = ?', {identifier, roomNumber, paidUntil, paidUntil}) -- Give key item giveItem(src, 'hotel_key', 1, {room = roomNumber})
-- NUI callback for payment RegisterNUICallback('payRoom', function(data, cb) SetNuiFocus(false, false) TriggerServerEvent('hotel:payRent', data.room, data.price) cb('ok') end) hotel script fivem
-- Spawn reception NPC Citizen.CreateThread(function() local model = Config.ReceptionNPC.model RequestModel(model) while not HasModelLoaded(model) do Citizen.Wait(10) end local npc = CreatePed(4, model, Config.ReceptionNPC.coords.x, Config.ReceptionNPC.coords.y, Config.ReceptionNPC.coords.z - 1.0, Config.ReceptionNPC.coords.w, false, true) SetEntityInvincible(npc, true) FreezeEntityPosition(npc, true) SetBlockingOfNonTemporaryEvents(npc, true) if removeMoney(src, price) then local paidUntil = os
-- Room door interaction Citizen.CreateThread(function() for _, room in pairs(Config.Rooms) do exports['ox_target']:addBoxZone({ coords = room.doorCoords, size = vector3(0.6, 0.6, 1.2), rotation = 0, debug = false, options = { { name = 'use_room_key', label = 'Use Room Key', icon = 'fas fa-door-open', onSelect = function() TriggerServerEvent('hotel:useKey', room.number) end } } }) end end) paid_until) VALUES (?