-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.lua
18 lines (18 loc) · 862 Bytes
/
server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
RegisterServerEvent('voiture:CheckMoneyForVel')
AddEventHandler('voiture:CheckMoneyForVel', function(name, vehicle, price)
local source = source
TriggerEvent('es:getPlayerFromId', source, function(user)
local player = user.getIdentifier()
local vehicle = vehicle
local name = name
local price = tonumber(price)
if (tonumber(user.getMoney()) >= tonumber(price)) then
user.removeMoney((price))
TriggerEvent("coffregouverneur:ajoutTaxe", price)
TriggerClientEvent('voiture:FinishMoneyCheckForVel', source, name, vehicle, price)
TriggerClientEvent("es_freeroam:notify", source, "CHAR_SIMEON", 1, "Simeon", false, "Bonne route!\n")
else
TriggerClientEvent("es_freeroam:notify", source, "CHAR_SIMEON", 1, "Simeon", false, "Fonds insuffisants!\n")
end
end)
end)