forked from ixhal/ixhal-carwash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.lua
25 lines (22 loc) · 990 Bytes
/
server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
RegisterNetEvent('carwash:DoVehicleWashParticles', function(vehNet, use_props)
local src = source
TriggerClientEvent('carwash:DoVehicleWashParticles', -1, vehNet, src, use_props)
end)
lib.callback.register('carwash:CanPurchaseCarWash', function(source, cb)
local src = source
local Player = GetPlayer(src)
print("getmoney ",GetPlayerAccountBalance(Player, Config.cash_account_name))
if (GetPlayerAccountBalance(Player, Config.cash_account_name) >= Config.cost or GetPlayerAccountBalance(Player, Config.bank_account_name) >= Config.cost) then
print("passou 1")
if RemovePlayerMoney(Player, Config.cash_account_name, Config.cost, 'Washed Vehicle') then
print("passou 2")
return true
elseif RemovePlayerMoney(Player, Config.bank_account_name, Config.cost, 'Washed Vehicle') then
print("passou 3")
return true
end
else
print("return falses")
return false
end
end)