mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Minor statement fix
This commit is contained in:
+23
-27
@@ -49,36 +49,32 @@ ESX.RegisterServerCallback('esx_weaponshop:buyWeapon', function(source, cb, weap
|
||||
if price == 0 then
|
||||
print(('esx_weaponshop: %s attempted to buy a unknown weapon!'):format(xPlayer.identifier))
|
||||
cb(false)
|
||||
end
|
||||
|
||||
if xPlayer.hasWeapon(weaponName) then
|
||||
TriggerClientEvent('esx:showNotification', source, _U('already_owned'))
|
||||
cb(false)
|
||||
else
|
||||
if zone == 'BlackWeashop' then
|
||||
|
||||
if xPlayer.getAccount('black_money').money >= price then
|
||||
xPlayer.removeAccountMoney('black_money', price)
|
||||
xPlayer.addWeapon(weaponName, 42)
|
||||
|
||||
cb(true)
|
||||
else
|
||||
TriggerClientEvent('esx:showNotification', source, _U('not_enough_black'))
|
||||
cb(false)
|
||||
end
|
||||
|
||||
if xPlayer.hasWeapon(weaponName) then
|
||||
TriggerClientEvent('esx:showNotification', source, _U('already_owned'))
|
||||
cb(false)
|
||||
else
|
||||
|
||||
if xPlayer.getMoney() >= price then
|
||||
xPlayer.removeMoney(price)
|
||||
xPlayer.addWeapon(weaponName, 42)
|
||||
|
||||
cb(true)
|
||||
else
|
||||
TriggerClientEvent('esx:showNotification', source, _U('not_enough'))
|
||||
cb(false)
|
||||
end
|
||||
if zone == 'BlackWeashop' then
|
||||
if xPlayer.getAccount('black_money').money >= price then
|
||||
xPlayer.removeAccountMoney('black_money', price)
|
||||
xPlayer.addWeapon(weaponName, 42)
|
||||
|
||||
cb(true)
|
||||
else
|
||||
TriggerClientEvent('esx:showNotification', source, _U('not_enough_black'))
|
||||
cb(false)
|
||||
end
|
||||
else
|
||||
if xPlayer.getMoney() >= price then
|
||||
xPlayer.removeMoney(price)
|
||||
xPlayer.addWeapon(weaponName, 42)
|
||||
|
||||
cb(true)
|
||||
else
|
||||
TriggerClientEvent('esx:showNotification', source, _U('not_enough'))
|
||||
cb(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user