mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 02:38:53 +00:00
Add files
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
ESX = nil
|
||||
|
||||
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
|
||||
|
||||
RegisterServerEvent('esx_barbershop:pay')
|
||||
AddEventHandler('esx_barbershop:pay', function()
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
xPlayer.removeMoney(Config.Price)
|
||||
|
||||
TriggerClientEvent('esx:showNotification', source, 'Vous avez payé $' .. Config.Price)
|
||||
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_barbershop:checkMoney', function(source, cb)
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer.get('money') >= Config.Price then
|
||||
cb(true)
|
||||
else
|
||||
cb(false)
|
||||
end
|
||||
|
||||
end)
|
||||
Reference in New Issue
Block a user