mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Cleanup, fixed #6
This commit is contained in:
+4
-14
@@ -4,25 +4,15 @@ TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
|
||||
|
||||
RegisterServerEvent('esx_barbershop:pay')
|
||||
AddEventHandler('esx_barbershop:pay', function()
|
||||
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
|
||||
xPlayer.removeMoney(Config.Price)
|
||||
|
||||
TriggerClientEvent('esx:showNotification', source, _U('you_paid') .. '$' .. Config.Price)
|
||||
|
||||
TriggerClientEvent('esx:showNotification', source, _U('you_paid', ESX.Math.GroupDigits(Config.Price)))
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_barbershop:checkMoney', function(source, cb)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
|
||||
if xPlayer.get('money') >= Config.Price then
|
||||
cb(true)
|
||||
else
|
||||
cb(false)
|
||||
end
|
||||
|
||||
cb(xPlayer.get('money') >= Config.Price)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user