Accessible code
Notification = function (title, description, type)
-- types are success and error
lib.notify({
title = title,
description = description,
type = type
})
end
Config = {
locales = 'en',
textUIAlign = 'right-center',
menuAlign = 'top-right',
useTarget = false,
targetType = 'ox', -- ox, qb
drawDistance = 20.0,
interactionDistance = 1.5,
commands = {
[1] = {
command = 'vehshops',
help = 'Vehicle Shops Menu',
permission = 'group.admin',
},
},
rentDays = {
[1] = '1 Day',
[7] = '7 Days',
[30] = '30 Days',
},
speedType = 'KMH', -- KMH, MPH
testTime = 30, -- in seconds
testPlate = 'UNIQTEAM',
deliveryTime = 1, -- in hours
vehicleColors = { -- you can find colors on https://wiki.rage.mp/index.php?title=Vehicle_Colors
{ label = "Metallic Black", value = 0 },
{ label = "Metallic Graphite Black", value = 1 },
{ label = "Metallic Black Steal", value = 2 },
{ label = "Metallic Dark Silver", value = 3 },
{ label = "Metallic Silver", value = 4 },
{ label = "Metallic Blue Silver", value = 5 },
{ label = "Metallic Steel Gray", value = 6 },
{ label = "Metallic Shadow Silver", value = 7 },
{ label = "Metallic Stone Silver", value = 8 },
{ label = "Metallic Midnight Silver", value = 9 },
{ label = "Metallic Gun Metal", value = 10 },
{ label = "Metallic Anthracite Grey", value = 11 },
{ label = "Matte Black", value = 12 },
{ label = "Matte Gray", value = 13 },
{ label = "Matte Light Grey", value = 14 },
{ label = "Util Black", value = 15 },
{ label = "Util Black Poly", value = 16 },
{ label = "Util Dark silver", value = 17 },
{ label = "Util Silver", value = 18 },
{ label = "Util Gun Metal", value = 19 },
{ label = "Util Shadow Silver", value = 20 },
{ label = "Worn Black", value = 21 },
{ label = "Worn Graphite", value = 22 },
{ label = "Worn Silver Grey", value = 23 },
{ label = "Worn Silver", value = 24 },
{ label = "Worn Blue Silver", value = 25 },
{ label = "Worn Shadow Silver", value = 26 },
{ label = "Metallic Red", value = 27 },
{ label = "Metallic Torino Red", value = 28 },
{ label = "Metallic Formula Red", value = 29 },
{ label = "Metallic Blaze Red", value = 30 },
{ label = "Metallic Graceful Red", value = 31 },
{ label = "Metallic Garnet Red", value = 32 },
{ label = "Metallic Desert Red", value = 33 },
{ label = "Metallic Cabernet Red", value = 34 },
{ label = "Metallic Candy Red", value = 35 },
{ label = "Metallic Sunrise Orange", value = 36 },
{ label = "Metallic Classic Gold", value = 37 },
{ label = "Metallic Orange", value = 38 },
{ label = "Matte Red", value = 39 },
{ label = "Matte Dark Red", value = 40 },
{ label = "Matte Orange", value = 41 },
{ label = "Matte Yellow", value = 42 },
{ label = "Util Red", value = 43 },
{ label = "Util Bright Red", value = 44 },
{ label = "Util Garnet Red", value = 45 },
{ label = "Worn Red", value = 46 },
{ label = "Worn Golden Red", value = 47 },
{ label = "Worn Dark Red", value = 48 },
{ label = "Metallic Dark Green", value = 49 },
{ label = "Metallic Racing Green", value = 50 },
{ label = "Metallic Sea Green", value = 51 },
{ label = "Metallic Olive Green", value = 52 },
{ label = "Metallic Green", value = 53 },
{ label = "Metallic Gasoline Blue Green", value = 54 },
{ label = "Matte Lime Green", value = 55 },
{ label = "Util Dark Green", value = 56 },
{ label = "Util Green", value = 57 },
{ label = "Worn Dark Green", value = 58 },
{ label = "Worn Green", value = 59 },
{ label = "Worn Sea Wash", value = 60 },
{ label = "Metallic Midnight Blue", value = 61 },
{ label = "Metallic Dark Blue", value = 62 },
{ label = "Metallic Saxony Blue", value = 63 },
{ label = "Metallic Blue", value = 64 },
{ label = "Metallic Mariner Blue", value = 65 },
{ label = "Metallic Harbor Blue", value = 66 },
{ label = "Metallic Diamond Blue", value = 67 },
{ label = "Metallic Surf Blue", value = 68 },
{ label = "Metallic Nautical Blue", value = 69 },
{ label = "Metallic Bright Blue", value = 70 },
{ label = "Metallic Purple Blue", value = 71 },
{ label = "Metallic Spinnaker Blue", value = 72 },
{ label = "Metallic Ultra Blue", value = 73 },
{ label = "Metallic Bright Blue", value = 74 },
{ label = "Util Dark Blue", value = 75 },
{ label = "Util Midnight Blue", value = 76 },
{ label = "Util Blue", value = 77 },
{ label = "Util Sea Foam Blue", value = 78 },
{ label = "Util Lightning blue", value = 79 },
{ label = "Util Maui Blue Poly", value = 80 },
{ label = "Util Bright Blue", value = 81 },
{ label = "Matte Dark Blue", value = 82 },
{ label = "Matte Blue", value = 83 },
{ label = "Matte Midnight Blue", value = 84 },
{ label = "Worn Dark blue", value = 85 },
{ label = "Worn Blue", value = 86 },
{ label = "Worn Light blue", value = 87 },
{ label = "Metallic Taxi Yellow", value = 88 },
{ label = "Metallic Race Yellow", value = 89 },
{ label = "Metallic Bronze", value = 90 },
{ label = "Metallic Yellow Bird", value = 91 },
{ label = "Metallic Lime", value = 92 },
{ label = "Metallic Champagne", value = 93 },
{ label = "Metallic Pueblo Beige", value = 94 },
{ label = "Metallic Dark Ivory", value = 95 },
{ label = "Metallic Choco Brown", value = 96 },
{ label = "Metallic Golden Brown", value = 97 },
{ label = "Metallic Light Brown", value = 98 },
{ label = "Metallic Straw Beige", value = 99 },
{ label = "Metallic Moss Brown", value = 100 },
{ label = "Metallic Biston Brown", value = 101 },
{ label = "Metallic Beechwood", value = 102 },
{ label = "Metallic Dark Beechwood", value = 103 },
{ label = "Metallic Choco Orange", value = 104 },
{ label = "Metallic Beach Sand", value = 105 },
{ label = "Metallic Sun Bleeched Sand", value = 106 },
{ label = "Metallic Cream", value = 107 },
{ label = "Util Brown", value = 108 },
{ label = "Util Medium Brown", value = 109 },
{ label = "Util Light Brown", value = 110 },
{ label = "Metallic White", value = 111 },
{ label = "Metallic Frost White", value = 112 },
{ label = "Worn Honey Beige", value = 113 },
{ label = "Worn Brown", value = 114 },
{ label = "Worn Dark Brown", value = 115 },
{ label = "Worn straw beige", value = 116 },
{ label = "Brushed Steel", value = 117 },
{ label = "Brushed Black steel", value = 118 },
{ label = "Brushed Aluminium", value = 119 },
{ label = "Chrome", value = 120 },
{ label = "Worn Off White", value = 121 },
{ label = "Util Off White", value = 122 },
{ label = "Worn Orange", value = 123 },
{ label = "Worn Light Orange", value = 124 },
{ label = "Metallic Securicor Green", value = 125 },
{ label = "Worn Taxi Yellow", value = 126 },
{ label = "Police Car Blue", value = 127 },
{ label = "Matte Green", value = 128 },
{ label = "Matte Brown", value = 129 },
{ label = "Worn Orange", value = 130 },
{ label = "Matte White", value = 131 },
{ label = "Worn White", value = 132 },
{ label = "Worn Olive Army Green", value = 133 },
{ label = "Pure White", value = 134 },
{ label = "Hot Pink", value = 135 },
{ label = "Salmon Pink", value = 136 },
{ label = "Metallic Vermillion Pink", value = 137 },
{ label = "Orange", value = 138 },
{ label = "Green", value = 139 },
{ label = "Blue", value = 140 },
{ label = "Metallic Black Blue", value = 141 },
{ label = "Metallic Black Purple", value = 142 },
{ label = "Metallic Black Red", value = 143 },
{ label = "Hunter Green", value = 144 },
{ label = "Metallic Purple", value = 145 },
{ label = "Metallic V Dark Blue", value = 146 },
{ label = "Modshop Black1", value = 147 },
{ label = "Matte Purple", value = 148 },
{ label = "Matte Dark Purple", value = 149 },
{ label = "Metallic Lava Red", value = 150 },
{ label = "Matte Forest Green", value = 151 },
{ label = "Matte Olive Drab", value = 152 },
{ label = "Matte Desert Brown", value = 153 },
{ label = "Matte Desert Tan", value = 154 },
{ label = "Matte Foilage Green", value = 155 },
{ label = "Default Alloy Color", value = 156 },
{ label = "Epsilon Blue", value = 157 },
{ label = "Pure Gold", value = 158 },
{ label = "Brushed Gold", value = 159 }
},
categoryIcons = {
['Cars'] = 'fa-solid fa-car',
['Motorcycles'] = 'fa-solid fa-motorcycle',
['Aircrafts'] = 'fa-solid fa-helicopter',
['Boats'] = 'fa-solid fa-sailboat',
},
defaultVehicles = {
['Cars'] = 'adder',
['Motorcycles'] = 'bati',
['Aircrafts'] = 'seabreeze',
['Boats'] = 'seashark',
},
vehicles = {
['Cars'] = {
['adder'] = {
label = 'Adder',
image = '',
price = 50000,
rentPrice = 5000, -- per day
},
['blista'] = {
label = 'Blista',
image = '',
price = 10000,
rentPrice = 1000, -- per day
},
},
['Motorcycles'] = {
['bati'] = {
label = 'Bati',
image = '',
price = 5000,
rentPrice = 500, -- per day
},
},
['Aircrafts'] = {
['buzzard2'] = {
label = 'Buzzard 2',
image = '',
price = 100000,
rentPrice = 1000, -- per day
},
['seabreeze'] = {
label = 'Seabreeze',
image = '',
price = 75000,
rentPrice = 7500, -- per day
},
},
['Boats'] = {
['seashark'] = {
label = 'Seashark',
image = '',
price = 75000,
rentPrice = 7500, -- per day
},
['marquis'] = {
label = 'Marquis',
image = '',
price = 10000,
rentPrice = 1000, -- per day
},
}
},
enableKeysSystem = false,
giveVehicleKey = function (vehicle, plate)
-- TriggerEvent('vehiclekeys:client:SetOwner', plate) -- QB
end,
enableCustomPlateGenerator = false,
generatePlate = function ()
local plate = 'UNIQTEAM'
return plate
end,
insertRentVehicleToDB = function (days, plate, vehicle, vehProps, owner, license)
if IsQBCore() then
local id = MySQL.insert.await('INSERT INTO `player_vehicles` (citizenid, vehicle, mods, plate, state, rentDays, license) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
owner, vehicle, vehProps, plate, 0, days, license, 'pillboxgarage'
})
return id ~= 0
elseif IsESX() then
local id = MySQL.insert.await('INSERT INTO `owned_vehicles` (owner, plate, vehicle, stored, rentDays) VALUES (?, ?, ?, ?, ?)', {
owner, plate, vehProps, 0, days
})
return id ~= 0
end
end,
insertVehicleToDB = function (plate, vehicle, vehProps, owner, license)
if IsQBCore() then
local id = MySQL.insert.await('INSERT INTO `player_vehicles` (citizenid, vehicle, mods, plate, state, license, garage) VALUES (?, ?, ?, ?, ?, ?, ?)', {
owner, vehicle, vehProps, plate, 0, license, 'pillboxgarage'
})
return id ~= 0
elseif IsESX() then
local id = MySQL.insert.await('INSERT INTO `owned_vehicles` (owner, plate, vehicle, stored) VALUES (?, ?, ?, ?)', {
owner, plate, vehProps, 0
})
return id ~= 0
end
end
}
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'] = {
menu = {
vehshop = {
title = 'Vehicle Shop Menu',
buttons = {
create = 'Create Shop',
delete = 'Delete Shop',
edit = 'Edit Shop',
refresh = 'Refresh Data',
}
},
showroom = {
title = 'Show Room',
description = 'Click to check %s category',
vehPrice = 'Price is %s$',
noVehicle = 'There are currently no vehicles'
},
vehicleMenu = {
primary = 'Primary Color',
secondary = 'Secondary Color',
test = {
title = 'Test Drive',
description = 'Test vehicle on city road'
},
rent = {
title = 'Rent Vehicle',
description = 'Rent a vehicle for a certain number of days',
},
rentValues = '%s ( %s$ )',
purchase = {
title = 'Purchase',
description = 'Purchase %s for %s$'
},
}
},
input = {
createShop = {
title = 'Create Vehicle Shop',
inputs = {
name = 'Enter Name',
price = 'Enter Price',
balance = 'Enter Start Balance',
owner = 'Select Owner',
category = 'Select Category',
rentDays = 'Select Rent Days Options',
stock = 'Enable Stock System',
purchase = 'Disable Purchasing Shop',
blip = 'Enable Blip',
}
},
addVehicle = {
title = 'Add Vehicles',
inputs = {
select = 'Select Vehicles',
}
},
deleteShop = {
title = 'Delete Shop',
inputs = {
select = 'Select Shop',
}
},
blip = {
title = 'Shop Blip',
inputs = {
id = 'Blip ID',
color = 'Blip Color',
scale = 'Blip Scale',
display = 'Blip Display'
}
},
transferOwnership = {
title = 'Transfer Ownership',
inputs = {
select = 'Select Player'
}
},
deposit = {
title = 'Deposit Money',
inputs = {
amount = 'Enter Amount'
}
},
withdraw = {
title = 'Withdraw Money',
inputs = {
amount = 'Enter Amount'
}
},
stock = {
title = 'How much?',
inputs = {
amount = 'Enter Amount',
}
},
changePrice = {
title = 'Change Price',
inputs = {
amount = 'Enter Amount'
}
},
selectVehicle = {
amount = 'Enter Amount',
price = 'Enter Price',
sale = 'Put On Sale'
},
manageCategories = {
title = 'Manage Categories',
inputs = {
category = 'Select Categories',
}
},
manageRentDays = {
title = 'Manage Rent Days',
inputs = {
days = 'Select Days',
}
},
manageOwnership = {
title = 'Manage Ownership',
inputs = {
select = 'Select Action',
options = {
online = 'By Online',
offline = 'By Offline',
remove = 'Remove Owner'
}
}
},
manageOwnershipOnline = {
title = 'Manage Ownership (Online)',
inputs = {
select = 'Select Player',
}
},
manageOwnershipOffline = {
title = 'Manage Ownership (Offline)',
inputs = {
identifier = 'Enter Identifier',
}
},
manageBalance = {
title = 'Manage Balance',
inputs = {
amount = 'Enter Amount',
}
},
changeName = {
title = 'Change Name',
inputs = {
name = 'Enter New Name',
}
},
manageVehicles = {
title = 'Manage Vehicles',
inputs = {
vehicle = 'Select Vehicle(s)'
}
},
},
context = {
editShops = {
title = 'Edit Shops',
buttons = {
title = '%s Shop',
description = 'Click to edit this vehicle shop'
},
},
editShop = {
changeName = {
title = 'Change Name',
description = 'Change the name of the vehicle shop'
},
changePrice = {
title = 'Change Price',
description = 'Change the purchase price of this vehicle shop',
},
enableBlip = {
title = 'Enable Blip',
description = 'Enable blip of the vehicle shop on the map',
},
disableBlip = {
title = 'Disable Blip',
description = 'Disable blip of the vehicle shop on the map',
},
changeBossLoc = {
title = 'Change Boss Location',
description = 'Change the boss menu location',
},
changeShowcaseLoc = {
title = 'Change Showcase Location',
description = 'Change the showcase menu location',
},
changeShowcaseVehLoc = {
title = 'Change Showcase Vehicle Location',
description = 'Change vehicle location when viewing',
},
changeOutsideLoc = {
title = 'Change Outside Location',
description = 'Change location of the vehicle when testing or purchasing',
},
manageBalance = {
title = 'Manage Balance',
description = 'Change the balance of money in the vehicle shop',
},
manageOwnership = {
title = 'Manage Ownership',
description = 'Change or remove the owner of this vehicle shop',
},
manageRentDays = {
title = 'Manage Rent Days',
description = 'Change rental day options',
},
manageCategory = {
title = 'Manage Categories',
description = 'Manage categories in this vehicle shop',
},
manageVehicles = {
title = 'Manage Vehicles',
description = 'Manage vehicles in this vehicle shop',
},
disableStock = {
title = 'Disable Stock System',
description = 'Disable vehicle stocking in this vehicle shop',
},
enableStock = {
title = 'Enable Stock System',
description = 'Enable vehicle stocking in this vehicle shop',
},
disablePurchase = {
title = 'Disable Purchasing Shop',
description = 'Disable player to purchase this vehicle shop',
},
enablePurchase = {
title = 'Enable Purchasing Shop',
description = 'Enable player to purchase this vehicle shop',
},
deleteShop = {
title = 'Delete Shop',
description = 'Delete this vehicle shop',
},
},
bossMenu = {
title = 'Boss Menu',
buttons = {
checkinfo = {
title = 'Check Shop Info',
description = 'Check the information of this vehicle shop'
},
withdraw = {
title = 'Withdraw Money',
description = 'Withdraw money from the vehicle shop'
},
deposit = {
title = 'Deposit Money',
description = 'Deposit money at the vehicle shop'
},
vehicle = {
title = 'Vehicles Options',
description = 'Vehicle options in this vehicle shop'
},
transfer = {
title = 'Transfer Ownership',
description = 'Transfer ownership to another player'
},
sell = {
title = 'Sell Vehicle Shop',
description = 'Sell this vehicle shop for %s$'
},
}
},
manageVehicles = {
title = 'Manage Vehicle',
buttons = {
order = {
title = 'Order Vehicle',
description = 'Order the vehicle from the factory to come'
},
orderDescription = 'Click to purchase for %s$',
orderlist = {
title = 'Orders List',
description = 'See the list of vehicles ordered from the factory'
},
orderListOrder = {
title = '%s x%s',
description = 'To collect: %s | Category: %s',
},
vehicles = {
title = 'Vehicles',
description = 'List of vehicles in the vehicle shop'
},
vehiclesVeh = {
title = '%s x%s',
description = 'Click to modify vehicle settings',
},
changePrice = {
title = 'Change Price',
description = 'Change the price of the vehicle during purchase'
},
removeSale = {
title = 'Remove from Sale',
description = 'Remove the vehicle from sale in the catalog'
},
addSale = {
title = 'Add on Sale',
description = 'Add the vehicle to sale in the catalog'
},
claim = {
title = 'Claim',
description = 'Collect the order you placed'
},
chargeback = {
title = 'Chargeback',
description = 'Return the order to factory'
},
}
},
addVehicle = {
title = 'Add Vehicle',
description = 'Add new vehicle to this vehicle shop',
},
manageVehicle = {
title = 'Manage Vehicles',
description = 'Manage current vehicles in vehicle shop',
}
},
textUI = {
placeBoss = {
('Boss Marker \n'),
('ENTER - Place \n'),
('BACKSPACE - Cancel')
},
placeShowcase = {
('Showcase Marker \n'),
('ENTER - Place \n'),
('BACKSPACE - Cancel')
},
placeShowcaseveh = {
('Showcase Position \n'),
('MOUSE - Move \n'),
('← & → - Rotate Left or Right \n'),
('ENTER - Place \n'),
('BACKSPACE - Cancel')
},
placeOutside = {
('Purhcase/Test Position \n'),
('MOUSE - Move \n'),
('← & → - Rotate Left or Right \n'),
('ENTER - Place \n'),
('BACKSPACE - Cancel')
},
bossMenu = 'E - Boss Menu',
showroom = 'E - Showroom',
previewVehicle = {
('[ & ] - Rotate Vehicle \n'),
('Max Speed ( %s%s ) \n'),
('Acceleration ( %s ) \n'),
('Brakes ( %s ) \n'),
('Traction ( %s )'),
},
testDrive = {
('**Test Drive** \n'),
('Vehicle: **%s** \n'),
('Time Remaining: **%ssec**'),
},
},
dialog = {
purchaseShop = {
title = 'Confirmation',
content = 'Are you sure you want to buy this car shop for **%s**$'
},
info = {
title = 'Vehicle Shop Info',
content = {
('Shop Name: %s\n\n'),
('Shop Balance: %s$\n\n'),
('Shop Price: %s$\n\n'),
('Owner: %s\n\n'),
('Categories: %s\n\n'),
('Vehicles In Shop: %s\n\n'),
('Pending Orders: %s\n\n'),
}
},
rentConfirm = {
title = 'Confirmation',
content = 'Are you sure you want to confirm the **%s** vehicle rental for **%s** for **%s$**',
labels = {
cancel = 'Cancel',
confirm = 'Rent',
}
},
pruchaseConfirm = {
title = 'Confirmation',
content = 'Are you sure you want to confirm the **%s** vehicle purchase for **%s$**',
labels = {
cancel = 'Cancel',
confirm = 'Purchase',
}
}
},
notify = {
error = {
title = 'Error',
noMoneyPurchase = 'You dont have enough money to purchase this shop',
noMoneyDeposit = 'You dont have enough money to deposit',
noMoneyWithdraw = 'You dont have enough money to withdraw',
noMoneyOrder = 'You dont have enough money to purchase this order',
noMoneyRent = 'You dont have enough money to rent a vehicle',
noVehicleInShop = 'An error occurred but this vehicle is not in stock',
noMoneyPurchaseVeh = 'You dont have enough money to purchase this vehicle',
nameTaken = 'The name you entered is taken',
},
success = {
title = 'Success',
createdShop = 'You have successfully created a vehicle shop named %s',
purchasedShop = 'You successfully purchased shop %s for %s$',
soldShop = 'You successfully sold shop %s for %s$',
transferredOwnership = 'You have successfully transferred the ownership of this vehicle shop to %s',
depositedMoney = 'You have successfully deposited %s$ in the %s vehicle shop',
withdrawnMoney = 'You have successfully withdrawn %s$ from the %s vehicle shop',
orderPlaced = 'Your order is placed successfully. You paid %s$',
orderTaked = 'You have successfully claimed the order you placed',
orderChargebacked = 'You have successfully returned the order you placed',
priceChanged = 'You have successfully changed the price of the %s vehicle to %s$',
vehicleAddedOnSale = 'You have successfully added an %s vehicle for sale',
vehicleRemovedFromSale = 'You have successfully removed the %s vehicle from sale',
shopDeleted = 'You have successfully deleted the %s vehicle shop',
enabledPurchasable = 'You have successfully enabled purchasing option in %s vehicle shop',
disabledPurchasable = 'You have successfully disabled purchasing option in %s vehicle shop',
enabledStock = 'You have successfully enabled stock system in %s vehicle shop',
disabledStock = 'You have successfully disabled stock system in %s vehicle shop',
managedCategories = 'You have successfully managed the categories in this vehicle shop',
managedRentDays = 'You have successfully managed the rent days in this vehicle shop',
ownerRemoved = 'You have successfully removed owner of this vehicle shop',
ownerChanged = 'You have successfully changed owner to %s',
managedBalance = 'You have successfully changed your vehicle shop balance to %s$',
changedOutsideLoc = 'You have successfully changed the vehicle location when testing or purchasing',
changedShowcaseVecLoc = 'You have successfully changed the vehicle location when view it',
changedShowcaseLoc = 'You have successfully changed the location of the showroom menu',
changeBossLoc = 'You have successfully changed the location of the boss menu',
disabledBlip = 'You have successfully disabled vehicle shop blip',
enabledBlip = 'You have successfully enabled vehicle shop blip',
shopPriceChanged = 'You have successfully changed vehicle shop price to %s$',
nameChanged = 'You have successfully changed vehicle shop name to %s',
managedVehicles = 'You have successfully managed vehicles in this vehicle shop',
addedVehicles = 'You have successfully added vehicles to the vehicle shop',
}
},
logs = {
shopCreated = {
title = 'Vehicle Shop Created',
message = {
('Admin: **%s**\n'),
('Shop: **%s**\n'),
},
},
shopDeleted = {
title = 'Vehicle Shop Deleted',
message = {
('Admin: **%s**\n'),
('Shop: **%s**'),
}
},
shopPurchased = {
title = 'Vehicle Shop Purchased',
message = {
('Player: **%s**\n'),
('Shop: **%s**\n'),
('Price: **%s$**'),
}
},
shopSold = {
title = 'Vehicle Shop Sold',
message = {
('Player: **%s**\n'),
('Shop: **%s**'),
}
},
ownershipTransferred = {
title = 'Transferred Ownership',
message = {
('Player: **%s**\n'),
('New Owner: **%s**\n'),
('Shop: **%s**'),
}
},
depositedMoney = {
title = 'Deposited Money',
message = {
('Player: **%s**\n'),
('Amount: **%s$**\n'),
('New Balance: **%s$**\n'),
('Shop: **%s**'),
}
},
withdrawnMoney = {
title = 'Withdrawn Money',
message = {
('Player: **%s**\n'),
('Amount: **%s$**\n'),
('New Balance: **%s$**\n'),
('Shop: **%s**'),
}
},
vehiclePurchased = {
title = 'Vehicle Purchased',
message = {
('Shop: **%s**\n'),
('Player: **%s**\n'),
('Vehicle: **%s**\n'),
('Price: **%s$**\n'),
('Plate: **%s**'),
}
},
vehicleRented = {
title = 'Vehicle Rented',
message = {
('Shop: **%s**\n'),
('Player: **%s**\n'),
('Vehicle: **%s**\n'),
('Price: **%s$**\n'),
('Plate: **%s**\n'),
('Day(s): **%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
SetUpShops()
end)
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
PlayerData.job = job
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
SetUpShops()
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
function GetLicensePlayerData(Player)
return Player.identifier
e
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
SetUpShops()
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
SetUpShops()
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
function GetLicensePlayerData(Player)
return Player.PlayerData.license
end
Last updated