kibra-motelsv2

Current Version: 1.1.7

Setup

Step 1

Download the kibra-core file and Motel Maps then move it to the resources folder.
In your server's server.cfg file, issue a command to start kibra-vehicleshops and kibra-core below your infrastructure's current mainfile (qbcore or es_extended).
start kibra-core
start kibra-motelsv2
# Maps
start 1thmotel
start 2thmotel
start motelmap

Step 3

Open kibra-core/shared/main.lua. And choose your Shared.Framework == "ESX" infrastructure.
Shared.Framework == "ESX" -- or "QBCore"

Step 4

Open your server's database management panel (phpmyadmin or HeidiSQL). Insert the following sql code into your database.
CREATE TABLE `kibra-motels` (
`id` int(11) NOT NULL,
`motelid` int(11) NOT NULL,
`roomid` varchar(255) NOT NULL,
`owner` varchar(46) DEFAULT NULL,
`password` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`pdata` varchar(255) DEFAULT '[]',
`invoiceseen` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `kibra-motels-business` (
`id` int(11) NOT NULL,
`motel` varchar(255) NOT NULL,
`owner` varchar(46) DEFAULT NULL,
`money` float NOT NULL,
`roomprice` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `kibra-motels-cache` (
`id` int(11) NOT NULL,
`rid` text NOT NULL,
`citizenid` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `kibra-motels`
ADD PRIMARY KEY (`id`);
ALTER TABLE `kibra-motels-business`
ADD PRIMARY KEY (`id`);
ALTER TABLE `kibra-motels-cache`
ADD PRIMARY KEY (`id`);
ALTER TABLE `kibra-motels`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=75;
ALTER TABLE `kibra-motels-business`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
ALTER TABLE `kibra-motels-cache`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
COMMIT;

Step 5

You must set up according to the inventory you use in this Section.

QB-INVENTORY

First, qb-inventory is a valid setup for qs-inventory and lj-inventory.
Open the javascript file of your inventory. And search for a function called FormatItemInfo. There is an if condition inside the function. Add the following condition to these conditions.
} else if (itemData.name == "motelkey") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html('<p><strong>Motel: </strong><span>' + itemData.info.MotelName + '</span></p><p><strong>Room No: </strong><span>' + itemData.info.UnRealMotelRoom + '</span></p><p><strong>Password: </strong><span>' + itemData.info.Password + '</span></p>');

OX INVENTORY

Open ox_inventory/data/items.lua. Add this line of code to the table in the file.
['motelkey'] = {
label = 'Motel Key',
weight = 200,
stack = true,
close = true,
client = {
event = 'Kibra:Motels:V2:Client:MotelKeyUsed'
}
},

CORE INVENTORY

Open the core inventory script file. Next, open the file with the stashes. And add this line of code.
Inventories = {
["motelinventory"] = {
slots = 20,
rows = 5,
x = "20%",
y = "20%",
label = "Motel Inventory",
alwaysSave = true,
},
}
How can I duplicate a motel room?

config-file

Config = {}
Config.Support = "discord.gg/0resmon" or "https://discord.gg/kv3Q44xYWd"
SETUP_DOCUMENT_AND_DOWNLOAD_MAPS_FILES = "https://Framework.gitbook.io/kibra-docs/resources/kibra-motels-v2"
Config.PoliceJob = "police"
Config.MotelKeyItem = "motelkey" -- Room key Item
Config.AutomaticPaymentInstruction = true -- If you activate this feature, the player will not be charged. Room rental fee is deducted from the player's bank. However, if there is not enough money in the bank account, the lease agreement is terminated.
Config.Inventory = "ox" -- or "QBCore" or "core" or "ox"
Config.BillingSystem = "esx_billing" -- or "gks-phone" or "okokBilling" or "esx_billing" (only esx) or qb-phone (only qbcore)
Config.UIFixCommand = "uifix" -- Closes all UI screens that remain open on your screen.
Config.BillingLabel = "Motel Room Bill" -- When the Motel room rent invoice is issued to the player, the text that will appear as the title of the invoice.
Config.BillingCheckTime = 1800 -- This is the time period that determines how long the player will pay a motel room rent. You can type in seconds.
Config.PoliceJob = "police"
Config.PoliceRaid = true -- He lets the cops raid motel rooms.
Config.OpenDoorKey = "e" -- Keys to be opened by Motel Owner and police
Config.DefaultRoomRental = 100 -- Room rental price of derelict motels.
Config.MaximumRoomRentalPrice = 1000 -- The maximum amount of rent the Hotel Owner can make.
Config.ShowRoomNo = "showroomno" -- Command that makes all room numbers visible from afar when near the motel.
Config.StashSlots = 50 -- The maximum slot that the player can put in the hotel room.
Config.StashMaxWeight = 5000 -- The maximum weight level of the player's motel room storage.
Config.MotelBlips = true -- Makes motels appear on the map.
Config.MotelDefaultMoney = 1000 -- Initial money given to the business after the motel business is purchased.
Config.MotelBuyPayment = "bank" -- or cash
Config.MotelRoomRentPayment = "bank" -- or cash
Config.MotelRoomKeyDuplicatePayment = "cash" -- or bank
Config.MotelRoomKeyDuplicateFee = 100 -- Key extraction fee.
Config.MultiMotel = true -- Allows a player to have multiple hotel rooms.
Config.MotelSalePriceRatio = 2 -- The fee reimbursed when the motel owner sells the business.
Config.UIControls = {
ReceptionOpenKey = "[E]",
ExitOpenKey = "[E]",
ExitText = "Exit",
ReceptionText = "Reception",
AdminMenuText = "Boss Menu",
WardrobeOpenKey = "[E]",
WardrobeText = "Wardrobe"
}
Config.Controls = {
ReceptionOpenKey = 38,
ExitRoomKey = 38
}
Config.Motels = {
[1] = {
Teleport = false, -- Mark *TRUE* if your hotel is Teleported. Otherwise mark *FALSE*.
-----------------
MotelName = "Pinkcage Motel",
Owner = "",
BillingFee = 100, -- Rent Room Price
Blip = {BlipId = 475, Scale = 1.0, Color = 2}, -- Blip Settings
SocietyMoney = 0,
MotelCenterCoord = vector3(323.87, -208.83, 54.09), -- The coordinate of the motel's center point.
RoomRentPrice = 0,
SalePrice = 12000, -- The selling price of the motel.
AutoLock = true,
DoorHash = -1156992775, -- If it's a Motel with an MLO, type the Hash of the Gate.
Reception = vector3(324.79, -230.31, 54.22), -- The part where hotel rooms are purchased.
MarkerColor = {r = 255, g = 255, b = 255, a = 255},
Rooms = {
[1] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(307.32, -213.54, 54.22),
StashCoord = vector3(306.83, -208.62, 54.23), -- Stash Coord
StashLock = true,
Wardrobe = vector3(302.72, -206.84, 54.23) -- Clothe / Wardrobe
},
[2] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(311.24, -203.46, 54.22),
StashCoord = vector3(310.58, -198.72, 54.23), -- Stash Coord
StashLock = true,
Wardrobe = vector3(306.66, -197.1, 54.23) -- Clothe / Wardrobe
},
[3] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(315.78, -194.78, 54.23),
StashCoord = vector3(320.47, -194.08, 54.23), -- Stash Coord
StashLock = true,
Wardrobe = vector3(322.08, -190.49, 54.23) -- Clothe / Wardrobe
},
[4] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(314.97, -219.65, 58.02),
StashCoord = vector3(310.19, -220.31, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(308.42, -224.2, 58.02) -- Clothe / Wardrobe
},
[5] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(307.46, -213.35, 58.02),
StashCoord = vector3(306.92, -208.65, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(303.13, -206.9, 58.02) -- Clothe / Wardrobe
},
[6] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(311.21, -203.28, 58.02),
StashCoord = vector3(310.71, -198.76, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(306.86, -196.99, 58.02) -- Clothe / Wardrobe
},
[7] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(315.87, -194.88, 58.02),
StashCoord = vector3(320.48, -194.07, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(322.11, -190.42, 58.02) -- Clothe / Wardrobe
},
[8] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(339.09, -219.4, 54.22),
StashCoord = vector3(340.0, -223.78, 54.23), -- Stash Coord
StashLock = true,
Wardrobe = vector3(343.6, -225.87, 54.23) -- Clothe / Wardrobe
},
[9] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(342.9, -209.76, 54.22),
StashCoord = vector3(343.57, -214.25, 54.23), -- Stash Coord
StashLock = true,
Wardrobe = vector3(347.02, -215.76, 54.23) -- Clothe / Wardrobe
},
[10] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(346.89, -199.74, 54.22),
StashCoord = vector3(347.39, -204.22, 54.23), -- Stash Coord
StashLock = true,
Wardrobe = vector3(351.14, -206.08, 54.23) -- Clothe / Wardrobe
},
[11] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(334.76, -227.78, 58.05),
StashCoord = vector3(330.31, -227.94, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(328.59, -231.9, 58.02) -- Clothe / Wardrobe
},
[12] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(339.17, -219.36, 58.02),
StashCoord = vector3(339.79, -224.14, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(343.46, -225.8, 58.02) -- Clothe / Wardrobe
},
[13] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(343.03, -209.65, 58.02),
StashCoord = vector3(343.63, -214.24, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(347.23, -215.9, 58.02) -- Clothe / Wardrobe
},
[14] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(346.69, -199.79, 58.02),
StashCoord = vector3(347.45, -204.31, 58.02), -- Stash Coord
StashLock = true,
Wardrobe = vector3(350.95, -206.03, 58.02) -- Clothe / Wardrobe
},
}
},
[2] = {
Teleport = true,
-----------------
MotelName = "The Motor Motel",
Owner = "",
SocietyMoney = 0,
Blip = {BlipId = 475, Scale = 1.0, Color = 1},
MotelCenterCoord = vector3(958.29, -204.14, 73.11),
RoomRentPrice = 0,
BillingFee = 100,
SalePrice = 12000,
Reception = vector3(961.65, -193.82, 73.21),
MarkerColor = {r = 255, g = 255, b = 255, a = 255},
EnterRoomCoord = vector3(-1232.2, 3874.42, 154.114),
Rooms = {
[1] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
ExitCoord = vector3(-1231.5844726563,3874.0849609375,154.12721252441),
DoorCoord = vector3(953.10913085938,-196.56210327148,73.279808044434),
StashCoord = vector3(-1231.3692626953,3878.4912109375,154.11404418945),
Wardrobe = vector3(-1235.7816162109,3880.267578125,154.11428833008),
DoorLock = true,
StashLock = true,
},
}
},
[3] = {
Teleport = false, -- Mark *TRUE* if your hotel is Teleported. Otherwise mark *FALSE*.
-----------------
MotelName = "Kibra Motel",
Owner = "",
BillingFee = 300, -- Rent Room Price
Blip = {BlipId = 475, Scale = 1.0, Color = 6}, -- Blip Settings
SocietyMoney = 0,
MotelCenterCoord = vector3(-362.75549316406,52.329147338867,54.429763793945), -- The coordinate of the motel's center point.
RoomRentPrice = 0,
SalePrice = 150000, -- The selling price of the motel.
AutoLock = true,
DoorHash = -165345653, -- If it's a Motel with an MLO, type the Hash of the Gate.
Reception = vector3(-369.08197021484,50.178073883057,54.429763793945), -- The part where hotel rooms are purchased.
MarkerColor = {r = 255, g = 255, b = 255, a = 255},
Rooms = {
[1] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-362.18029785156,57.839267730713,54.429805755615),
StashCoord = vector3(-362.55160522461,61.792442321777,54.430606842041), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-364.94509887695,59.874801635742,54.430606842041) -- Clothe / Wardrobe
},
[2] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-350.53329467773,58.071712493896,54.470539093018), -- Door Coord,
StashCoord = vector3(-350.24911499023,62.041961669922,54.430599212646), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-347.19372558594,60.140018463135,54.430606842041) -- Clothe / Wardrobe
},
[3] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-343.89392089844,57.765537261963,54.465641021729), -- Door Coord,
StashCoord = vector3(-340.23114013672,58.917987823486,54.430603027344), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-344.97933959961,59.394481658936,54.4306640625) -- Clothe / Wardrobe
},
[4] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-333.03161621094,57.558052062988,54.46753692627), -- Door Coord,
StashCoord = vector3(-332.45455932617,61.759708404541,54.462219238281), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-330.08786010742,58.467704772949,54.461029052734) -- Clothe / Wardrobe
},
[5] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-329.23889160156,52.361763000488,58.796627044678), -- Door Coord,
StashCoord = vector3(-323.21258544922,51.763248443604,58.75732421875), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-326.6823425293,55.341571807861,58.756034851074) -- Clothe / Wardrobe
},
[6] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-332.91357421875,57.288600921631,58.747093200684), -- Door Coord,
StashCoord = vector3(-332.56039428711,61.643783569336,58.762889862061), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-329.94415283203,58.362426757813,58.753158569336) -- Clothe / Wardrobe
},
[7] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-344.3405456543,57.602161407471,58.746440887451), -- Door Coord,
StashCoord = vector3(-340.3147277832,58.765380859375,58.750003814697), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-344.79995727539,59.689231872559,58.750003814697) -- Clothe / Wardrobe
},
[8] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-350.72647094727,57.961734771729,58.785621643066), -- Door Coord,
StashCoord = vector3(-350.39846801758,62.762096405029,58.793880462646), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-347.07666015625,59.891399383545,58.751373291016) -- Clothe / Wardrobe
},
[9] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-361.89593505859,58.553089141846,58.773155212402), -- Door Coord,
StashCoord = vector3(-362.55596923828,63.37532043457,58.753154754639), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-364.86114501953,59.165878295898,58.753742218018) -- Clothe / Wardrobe
},
[10] = {
Owner = "",
Password= nil,
Date= nil,
pData = {},
DoorCoord = vector3(-366.71124267578,52.909496307373,58.747974395752), -- Door Coord,
StashCoord = vector3(-373.15927124023,53.503040313721,58.755355834961), -- Stash Coord
StashLock = true,
Wardrobe = vector3(-368.77578735352,56.586498260498,58.749950408936) -- Clothe / Wardrobe
},
}
}
}
-- Functions
Config.OpenMotelInventory = function(mid, rid)
local ox_inventory = exports.ox_inventory
if Config.Inventory == "ox" then
if exports.ox_inventory:openInventory('stash', 'motelStash_'..mid..'_'..rid) == false then
TriggerServerEvent('ox:motelStash', mid..'_'..rid)
exports.ox_inventory:openInventory('stash', 'motelStash_'..mid..'_'..rid)
end
elseif Config.Inventory == "QBCore" then
TriggerServerEvent("inventory:server:OpenInventory", "stash", "Motel_"..mid..'_'..rid)
TriggerEvent("inventory:client:SetCurrentStash", "Motel_"..mid..'_'..rid)
elseif Config.Inventory == "core" then
TriggerServerEvent('core_inventory:server:openInventory', "Motel_"..mid..'_'..rid, "stash")
end
end
Config.Stash = function(id)
local getTable = {
id = 'motelstash',
label = 'Motel Stash '..id,
slots = 50,
weight = 100000,
owner = id
}
return getTable
end
KIBRA = exports["kibra-core"]:GetCore()
Config.Notify = function(textx, type)
KIBRA.Natives.Notify(type, textx)
end
Config.ServerNotify = function(src, textx)
TriggerClientEvent('Kibra:Core:Notify', src, type, textx)
end
Config.Show = function(button, text)
KIBRA.Natives.UI.Show(button, text)
end
Config.Hide = function()
KIBRA.Natives.UI.Hide()
end
Config.OpenWardrobe = function()
if KIBRA.Natives.GetFramework() == "ESX" then
ESX = exports['es_extended']:getSharedObject()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room',{
title = 'Clothes',
align = 'right',
elements = {
{label = 'Clothes', value = 'player_dressing'},
{label = 'Delete Clothes', value = 'remove_cloth'}
}
}, function(data, menu)
if data.current.value == 'player_dressing' then
menu.close()
KIBRA.Natives.TriggerCallbackk('Kibra:Motels:V2:Server:GetPlayerClothes', function(dressing)
elements = {}
for i=1, #dressing, 1 do
table.insert(elements, {
label = dressing[i],
value = i
})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_dressing',
{
title = 'Clothes',
align = 'right',
elements = elements
}, function(data2, menu2)
TriggerEvent('skinchanger:getSkin', function(skin)
KIBRA.Natives.TriggerCallbackk('Kibra:Motels:V2:Server:GetPlayerOutfits', function(clothes)
TriggerEvent('skinchanger:loadClothes', skin, clothes)
TriggerEvent('esx_skin:setLastSkin', skin)
TriggerEvent('skinchanger:getSkin', function(skin)
TriggerServerEvent('esx_skin:save', skin)
end)
end, data2.current.value)
end)
end, function(data2, menu2)
menu2.close()
end)
end)
elseif data.current.value == 'remove_cloth' then
menu.close()
KIBRA.Natives.TriggerCallbackk('Kibra:Motels:V2:Server:GetPlayerClothes', function(dressing)
elements = {}
for i=1, #dressing, 1 do
table.insert(elements, {
label = dressing[i],
value = i
})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'remove_cloth', {
title = 'Delete Clothe',
align = 'right',
elements = elements
}, function(data2, menu2)
menu2.close()
TriggerServerEvent('Kibra:Motels:V2:Server:DeleteOutfit', data2.current.value)
Config.Notify('Clothes Deleted!')
end, function(data2, menu2)
menu2.close()
end)
end)
end
end, function(data, menu)
menu.close()
end)
else
TriggerEvent('qb-clothing:client:openOutfitMenu')
end
end
Config.Lang = {
["Thiskeydoesnotbelongtothisthing"] = "This key does not belong to this thing!",
["Locked"] = "Locked",
["EnterRoom"] = "Enter the Room",
["Stash"] = "Stash",
["YouLockedDoor"] = "You have locked the door",
["UnlockedDoor"] = "You unlocked the door.",
["SuccessDeposited"] = "You have successfully deposited money.",
["YouDontEnoughCash"] = "You don't have enough cash.",
["NotBlank"] = "You cannot leave this field blank.",
["SuccessMotelRename"] = "You have successfully changed the name of the motel.",
["SuccessWithdraw"] = "You have successfully withdrawn money.",
["EnoughCompanyMoney"] = "There is not enough money in the company vault.",
["SuccessMotelSell"] = "You have successfully sold your motel business.",
["Youdonthaveaccess"] = "You don't have access!",
["UpdateMotelPrice"] = "You have successfully updated the room rate.",
["MaxRoomPrice"] = "You can't put up that much rental price!",
["SuccessOwnershipTransfer"] = "You have successfully transferred ownership of the motel.",
["Thereisnoonenearyou"] = "There is no one near you!",
["LeaveMotelRoom"] = "You have successfully left your motel room.",
["SuccessKickMotelRoom"] = "You have successfully kicked the player out of the room.",
["CopyMotelKey"] = "You have successfully extracted the Motel room key",
["Enoughtforkey"] = "You don't have enough money to issue keys!",
["SuccessBuyMotel"] = "You have successfully purchased this motel.",
["Enoughtforbuymotel"] = "You don't have enough money to buy this motel.",
["OtherOwner"] = "This Motel Owns Someone Else.",
["SuccessRentMotelRoom"] = "You have successfully rented a motel room",
["Youalreadyhaveamotelroom"] = "You already have a motel room.",
["Youdonthaveenoughmoneytorentthisroom"] = "You don't have enough money to rent this room.",
["LockedStash"] = "You have locked your warehouse.",
["UnlockedStash"] = "You have unlocked your warehouse.",
["NewInvoice"] = "You have a new invoice.",
["CancelRoomSorryMan"] = "Your hotel room was canceled because you didn't pay your bill.",
["NewMotelBill"] = "You just got a new motel bill.",
["RentSuccess"] = "Your tenant has paid her rent.",
["NoAccessRoom"] = "You cannot enter your room because you have an unpaid Motel bill.",
["ReddiFatura"] = "Your room rental agreement has been canceled because you did not pay your room bill.",
["AutoSuccess"] = "The room rental fee was automatically withdrawn from your bank account.",
["BankandaParaYokMal"] = "Your hotel room was canceled because you didn't have enough money in your bank account."
}