Implemented boat license, closes #4. Added sql, closes #1

This commit is contained in:
ElPumpo
2018-08-05 12:09:51 +02:00
parent c3b7b88fe8
commit 409e8975f5
7 changed files with 90 additions and 10 deletions
+14
View File
@@ -87,6 +87,20 @@ ESX.RegisterServerCallback('esx_boat:getGarage', function (source, cb)
end)
ESX.RegisterServerCallback('esx_boat:buyBoatLicense', function (source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.getMoney() >= Config.LicensePrice then
xPlayer.removeMoney(Config.LicensePrice)
TriggerEvent('esx_license:addLicense', source, 'boat', function()
cb(true)
end)
else
cb(false)
end
end)
function getPriceFromModel(model)
for i=1, #Config.Vehicles, 1 do
if Config.Vehicles[i].model == model then