Skip to content
This repository has been archived by the owner on Oct 7, 2019. It is now read-only.

Commit

Permalink
Update es_carwash_server.lua
Browse files Browse the repository at this point in the history
Renamed all client and server side events
  • Loading branch information
TheSpartaPT authored Aug 28, 2017
1 parent 59d134b commit 37166a0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions es_carwash/es_carwash_server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ price = 100 -- you may edit this to your liking. if "enableprice = false" ignore

--DO-NOT-EDIT-BELLOW-THIS-LINE--

RegisterServerEvent('carwash:checkmoney')
AddEventHandler('carwash:checkmoney', function ()
RegisterServerEvent('es_carwash:checkmoney')
AddEventHandler('es_carwash:checkmoney', function ()
TriggerEvent('es:getPlayerFromId', source, function (user)
if enableprice == true then
userMoney = user.getMoney()
if userMoney >= price then
user.removeMoney(price)
TriggerClientEvent('carwash:success', source, price)
TriggerClientEvent('es_carwash:success', source, price)
else
moneyleft = price - userMoney
TriggerClientEvent('carwash:notenoughmoney', source, moneyleft)
TriggerClientEvent('es_carwash:notenoughmoney', source, moneyleft)
end
else
TriggerClientEvent('carwash:free', source)
TriggerClientEvent('es_carwash:free', source)
end
end)
end)
end)

0 comments on commit 37166a0

Please sign in to comment.