Accessible code
Notification = function (title, description, type)
-- types are success and error
lib.notify({
title = title,
description = description,
type = type
})
end
RaidMinigame = function ()
local success = lib.skillCheck({'easy', 'easy', {areaSize = 60, speedMultiplier = 2}, 'hard'}, {'w', 'a', 's', 'd'})
return success
end
function wardrobeMenu()
-- TriggerEvent('illenium-appearance:client:openOutfitMenu')
exports['fivem-appearance']:openWardrobe()
end
function openStash(stashId, stashWeight, stashSlots)
if Config.inventoryType == 'ox' then
exports.ox_inventory:openInventory('stash', stashId)
elseif Config.inventoryType == 'qb' or Config.inventoryType == 'lj' or Config.inventoryType == 'ps' or Config.inventoryType == 'qs' then
TriggerEvent("inventory:client:SetCurrentStash", stashId)
TriggerServerEvent("inventory:server:OpenInventory", "stash", stashId, {
maxweight = stashWeight,
slots = stashSlots,
})
elseif Config.inventoryType == 'core' then
TriggerServerEvent('core_inventory:server:openInventory', stashId, 'stash')
end
end
Config = {
locales = 'en',
inventoryType = 'ox', -- ox, qb, ps, lj, qs, core
textUIAlign = 'right-center',
menuUIAlign = 'top-right',
drawDistance = 20.0,
interactionDistance = 2.0,
enableWardrobe = true,
purchasePed = 'a_f_y_femaleagent',
whitelistJobs = {
'police'
},
roomShells = {
[1] = {
label = 'Mid Apartment',
shell = 'furnitured_midapart',
offsets = {
exit = {x = 1.373123, y = -10.018921, z = 0.00, h = 330.926605},
stash = { x = 4.162766, y = -5.244995, z = 0.00 },
clothe = { x = 6.013260, y = 9.316162, z = 0.00 },
}
},
[2] = {
label = 'Modern Apartment',
shell = 'modernhotel_shell',
offsets = {
exit = { x = 1.46, y = -10.0, z = 1.0, h = 0.39 },
stash = { x = 6.9, y = 4.04, z = 1.0 },
clothe = { x = 6.03, y = 9.29, z = 1.0 },
}
},
},
stashDefaultSettings = {
slots = 100,
weight = 10000
},
rentDays = {
[1] = { label = '1 Day', days = 1 },
[2] = { label = '2 Days', days = 2 },
[5] = { label = '5 Days', days = 5 },
[7] = { label = '7 Days', days = 7 },
[14] = { label = '14 Days', days = 14 },
[30] = { label = '30 Days', days = 30 },
},
commands = {
[1] = {
enable = true,
command = 'hotels',
permission = 'group.admin',
help = 'Hotels Menu ( Create, Edit, Delete Hotels )'
}
}
}
Logs = {
enable = false,
webhook = '',
botName = 'UNIQ TEAM',
colors = {
['green'] = 5024796,
['red'] = 12980754,
['blue'] = 1209030,
}
}
Notification = function (source, title, description, type)
-- types are success and error
TriggerClientEvent('ox_lib:notify', source, {
title = title,
description = description,
type = type
})
end
Translate['en'] = {
create_hotel = 'Create Hotel',
enter_name = 'Hotel Name',
input_price = 'Hotel Price',
rent_days_option = 'Rent Days Option',
price_per_room = 'Price Per New Room',
price_per_day = 'Price Per Day',
rooms_quantity = 'Rooms Quantity',
max_tenant = 'Max Tenant',
stash_weight = 'Stash Weight',
slots_number = 'Slots Number',
select_owner = 'Select Owner',
select_shell = 'Select Shell',
enable_blip = 'Enable Blip',
blip_settings = 'Blip Settings',
blip_id = 'Blip ID',
blip_color = 'Blip Color',
blip_scale = 'Blip Scale',
blip_display = 'Blip Display',
place_boss_marker = {
('ENTER - Place Boss Marker \n'),
('BACKSPACE - Cancel \n')
},
ped_move = {
('MOUSE - Move Ped \n'),
('ARROW LEFT AND RIGHT - Rotate ped \n'),
('ENTER - Finish \n'),
('BACKSPACE - Cancel')
},
change_name = 'Change Name',
change_name_desc = 'Change hotel name',
enable_blip_desc = 'Turn on the blip on the map',
disable_blip = 'Disable Blip',
disable_blip_desc = 'Turn off the blip from the map',
disable_blip_sure = 'Are you sure you want to turn off the blip from the map?',
confirmation = 'Confirmation',
manage_blip = 'Manage Blip',
manage_blip_desc = 'Mnaage blip on the map of this hotel',
move_boss_menu = 'Move Boss Menu',
move_boss_menu_desc = 'Change marker location for hotel owner',
move_rent_ped = 'Move Rent Ped',
move_rent_ped_desc = 'Move ped for renting rooms',
manage_balance = 'Manage Balance',
manage_balance_desc = 'Change the balance of this hotel',
input_amount = 'Amount',
change_price = 'Change Price',
change_price_desc = 'Change the purchase price of this hotel',
change_price_per_day = 'Change Price Per Day',
change_price_per_room = 'Change Price Per Room',
change_price_per_room_desc = 'Change the price of adding a new room',
manage_ownership = 'Manage Ownership',
manage_ownership_desc = 'Change or remove hotel owner',
selecT_action = 'Select Action',
remove_owner = 'Remove Owner',
by_online = 'By Online',
by_offline = 'By Offline',
select_player = 'Select Player',
select_players = 'Select Players',
input_identifier = 'Input Identifier',
manage_rent_options = 'Manage Rent Options',
manage_rent_options_desc = 'Change the general rental days',
select_days = 'Select Days',
manage_rooms = 'Manage Rooms',
manage_rooms_desc = 'Customize the rooms of this hotel',
room = 'Room',
manage_hotel_room_desc = 'Click to manage hotel room',
manage_access = 'Manage Access',
manage_access_desc = 'Change the list of players who can access the hotel room',
manage_expire_date = 'Manage Rent Expire Date',
manage_expire_date_desc = 'Change the room rental expiration date',
select_date = 'Select Date',
move_entrance = 'Move Entrance',
move_entrance_desc = 'Move the entrance coords from room #%s',
place_entrance = 'ENTER - Place Entrance for Room #%s \n BACKSPACE - Cancel \n',
change_interior = 'Change Interior',
change_interior_desc = 'Change hotel interior',
select_interior = 'Select Interior',
change_stash = 'Stash Options',
change_stash_desc = 'Change inventory options (weight and slots)',
input_weight = 'Input Weight',
input_slots_amount = 'Input Slots Amount',
change_max_tenant = 'Change Max Tenant',
change_max_tenant_desc = 'Change the maximum number of people a room owner can place as tenants',
delete_hotel = 'Delete Hotel',
delete_hotels = 'Delete Hotels',
delete_hotel_sure = 'Are you sure you want to delete this hotel?',
edit_hotels = 'Edit Hotels',
hotel_name = 'Hotel %s',
select_hotels = 'Select Hotels',
hotels_menu = 'Hotels Menu',
hotel_menu = 'Hotel Menu',
rent_room = 'Rent Room',
room_id = 'Room #%s',
exit_room = 'Exit Room',
wardrobe = 'Wardrobe',
stash = 'Stash',
buy_hotel_sure = 'Are you sure you want to buy Hotel %s? \nPrice: **%s$**',
hotel_info = 'Hotel Info',
hotel_info_text = 'Name: **%s** \nPrice: **%s$** \nBalance: **%s$** \n\nPrice per new room: **%s$** \nPrice per day: **%s$** \nPrice days options: **%s** \nNumber of rooms: **%s** \n',
close = 'Close',
check_rooms = 'Check Rooms',
check_rooms_desc = 'Check the status of the rooms in the hotel',
rented = 'Rented: %s',
add_room = 'Add Room',
add_room_desc = 'Add another room to your hotel for $%s',
add_room_textui = {
('Add new room \n'),
('ENTER - Place Enterance \n'),
('BACKSPACE - Cancel'),
},
add_room_sure = 'Are you sure you want to add a new room at this location?',
not_enough_money = 'You don\'t have enough money',
manage_tenant = 'Manage Tenant',
manage_tenant_desc = 'Change the maximum number of tenants in one room',
manage_day_price = 'Manage Day Price',
manage_day_price_desc = 'Change the price of payment per day for rooms',
manage_days_options = 'Manage Days Options',
manage_days_options_desc = 'Change the day option for renting a room',
select_options = 'Select Options',
money_options = 'Money',
money_options_desc = 'Check balance, withdraw or deposit money',
balance = 'Balance: $%s',
deposit_money = 'Deposit Money',
withdraw_money = 'Withdraw Money',
sell_hotel = 'Sell Hotel',
sell_hotel_desc = 'Sell hotel to the state for $%s',
sell_hotel_sure = 'Are you sure you want to sell **Hotel %s** \nPrice: **$%s**',
room_info = 'Price: $%s/day | Rented: %s',
rent_room_sure = 'Are you sure you want to pay the room rent for **$%s** for **%s** days',
enter_room = 'Enter Room',
raid_room = 'Raid Room',
raid_room_desc = 'Break into the room and find something legal',
failed_minigame = 'You failed to pass the minigame',
rent_expires = 'Rent of this room expires: %s | Click to renew the rent',
cant_have_tenats = 'You cannot have %s tenants, it is possible to have %s',
cancel_rent = 'Cancel Rent',
cancel_rent_sure = 'Are you sure you want to end the rent of this room? Everything will destock you and the room will no longer be yours',
check_room = 'Check The Room',
name_taken = 'Name %s is already taken',
hotel_created = 'You have successfully created a hotel %s',
hotel_bought = 'You have successfully bought Hotel %s for $%s',
manage_days_success = 'You have successfully changed the room rental day options',
success_deposit = 'You have successfully deposited $%s in your hotel',
success_withdraw = 'You have successfully withdrawn $%s from your hotel',
manage_day_price_success = 'You have successfully changed the price of the day at your hotel to $%s',
manage_tenat_success = 'You have successfully changed the maximum number of tenants in rooms to %s',
added_room = 'You have successfully added a new room for $%s',
hotel_sold = 'You successfully sold Hotel %s for $%s',
success_rented = 'You successfully rented Room #%s for $%s for %s day(s)',
rent_renewed = 'You successfully renewed rent of Room #%s for $%s for %s day(s)',
success_cancel = 'You successfully cancelled rent Room #%s',
success_manage_access = 'You have successfully changed the list of people who can access room',
success_hotelname_change = 'You have successfully changed the name of the hotel to %s',
hotel_balance_changed = 'You have successfully changed the hotel balance to $%s',
hotel_price_changed = 'You have successfully changed the hotel balance to $%s',
price_per_day_changed = 'You have successfully changed the hotel price per day to $%s',
price_per_room_changed = 'You have successfully changed the hotel price per room to $%s',
hotel_owner_noowner = 'You have successfully removed the owner of hotel $%s',
hotel_owner_changed = 'You have successfully removed the owner of hotel $%s',
interior_changed = 'You have successfully changed interior of the hotel',
stash_option_changed = 'You have successfully changed the options of stashes',
change_max_tenats = 'You have successfully changed the maximum number of tenants',
room_owner_removed = 'You have successfully removed owner of room #%s',
room_owner_changed = 'You have successfully changed owner of room to %s',
room_rental_end_date = 'You have successfully changed the end date of the room rental to %s',
entrance_location_change = 'You have successfully changed the location of the entrance to room #%s',
deleted_hotel = 'You have successfully deleted Hotel %s',
selected_hotels_deleted = 'You have successfully deleted all selected hotels',
logs = {
hotelCreated = {
title = 'Hotel Created',
message = {
('Admin: **%s**\n'),
('Hotel Data: ```lua\n %s\n```'),
},
},
rentRoom = {
title = 'Hotel Room Rented',
message = {
('Player: **%s**\n'),
('Hotel: **%s**\n'),
('Days: **%s**\n'),
('Cost: **$%s**'),
},
},
renewRent = {
title = 'Hotel Rent Renewed',
message = {
('Player: **%s**\n'),
('Hotel: **%s**\n'),
('Room Number: **#%s**\n'),
('Days: **%s**\n'),
('Cost: **$%s**'),
},
},
cancelRent = {
title = 'Hotel Room Canceled',
message = {
('Player: **%s**\n'),
('Hotel: **%s**\n'),
('Room Number: **#%s**'),
},
},
hotelPurchased = {
title = 'Hotel Purchased',
message = {
('Player: **%s**\n'),
('Hotel: **%s**\n'),
('Price: **$%s**\n'),
},
},
addNewRoom = {
title = 'Hotel Room Added',
message = {
('Hotel Owner: **%s**\n'),
('Hotel: **%s**\n'),
('Cost: **$%s**\n'),
('Number Of Rooms: **%s**'),
},
},
manageMaxTenant = {
title = 'Hotel Max Tenants Edited',
message = {
('Hotel Owner: **%s**\n'),
('Hotel: **%s**\n'),
('Max Tenants: **%s**'),
},
},
manageDayPrice = {
title = 'Hotel Day Price Edited',
message = {
('Hotel Owner: **%s**\n'),
('Hotel: **%s**\n'),
('Day Price: **$%s**'),
},
},
manageDays = {
title = 'Hotel Days Edited',
message = {
('Hotel Owner: **%s**\n'),
('Hotel: **%s**\n'),
('Days: ```lua\n %s \n```\n'),
},
},
depositMoney = {
title = 'Hotel Money Deposited',
message = {
('Hotel Owner: **%s**\n'),
('Hotel: **%s**\n'),
('Amount Deposited: **$%s**'),
},
},
withdrawMoney = {
title = 'Hotel Money Withdrawn',
message = {
('Hotel Owner: **%s**\n'),
('Hotel: **%s**\n'),
('Amount Withdrew: **$%s**'),
},
},
sellHotel = {
title = 'Hotel Sold',
message = {
('Hotel Owner: **%s**\n'),
('Hotel: **%s**\n'),
('Sold For: **$%s**'),
},
},
}
}
client.lua:
if not IsESX() then return end
local ESX = exports['es_extended']:getSharedObject()
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerData = xPlayer
PlayerLoaded = true
SetUpHotels()
end)
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
PlayerData.job = job
end)
RegisterNetEvent('esx:setAccountMoney')
AddEventHandler('esx:setAccountMoney', function(account)
for i = 1, #(PlayerData.accounts) do
if PlayerData.accounts[i].name == account.name then
PlayerData.accounts[i] = account
break
end
end
end)
RegisterNetEvent('esx:onPlayerLogout', function()
table.wipe(PlayerData)
PlayerLoaded = false
end)
AddEventHandler('onResourceStart', function(resource)
if cache.resource == resource then
Wait(1500)
PlayerData = ESX.GetPlayerData()
PlayerLoaded = true
SetUpHotels()
end
end)
function GetIdentifier()
return PlayerData.identifier
end
function GetPlayerMoney()
for k,v in pairs(PlayerData.accounts) do
if v.name == 'money' then return v.money end
end
end
function GetJob()
return PlayerData.job.label
end
server.lua:
if not IsESX() then return end
local ESX = exports['es_extended']:getSharedObject()
function GetPlayerBySource(source)
return ESX.GetPlayerFromId(source)
end
function GetPlayerSource(Player)
return Player.source
end
function GetPlayerByIdentifier(identifier)
return ESX.GetPlayerFromIdentifier(identifier)
end
function GetAllPlayers()
return ESX.GetExtendedPlayers()
end
function GetPlayerCharName(Player)
return Player.name
end
function GetIdentifierByPlayerData(Player)
return Player.identifier
end
function GetMoney(Player)
return Player.getMoney()
end
function AddMoney(Player, amount)
return Player.addMoney(amount)
end
function RemoveMoney(Player, amount)
return Player.removeMoney(amount)
end
client.lua:
if not IsQBCore() then return end
local QBCore = exports['qb-core']:GetCoreObject()
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
PlayerData = QBCore.Functions.GetPlayerData()
PlayerLoaded = true
SetUpHotels()
end)
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
table.wipe(PlayerData)
PlayerLoaded = false
end)
RegisterNetEvent('QBCore:Player:SetPlayerData', function(val)
PlayerData = val
end)
AddEventHandler('onResourceStart', function(resource)
if cache.resource == resource then
Wait(1500)
PlayerData = QBCore.Functions.GetPlayerData()
PlayerLoaded = true
SetUpHotels()
end
end)
function GetIdentifier()
return PlayerData.citizenid
end
function GetPlayerMoney()
return PlayerData.money['cash']
end
function GetJob()
return PlayerData.job.name
end
server.lua:
if not IsQBCore() then return end
local QBCore = exports['qb-core']:GetCoreObject()
function GetPlayerBySource(source)
return QBCore.Functions.GetPlayer(source)
end
function GetPlayerSource(Player)
return Player.PlayerData.source
end
function GetPlayerByIdentifier(id)
return QBCore.Functions.GetPlayerByCitizenId(id)
end
function GetAllPlayers()
return QBCore.Functions.GetQBPlayers()
end
function GetPlayerCharName(Player)
return Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname
end
function GetIdentifierByPlayerData(Player)
return Player.PlayerData.citizenid
end
function GetMoney(Player)
return Player.Functions.GetMoney('cash')
end
function AddMoney(Player, amount)
return Player.Functions.AddMoney('cash', amount)
end
function RemoveMoney(Player, amount)
return Player.Functions.RemoveMoney('cash', amount)
end
Last updated