Minor statement fix

This commit is contained in:
ElPumpo
2019-11-02 11:01:26 +01:00
parent 38ca6f0ecd
commit cbc5113d7b
+23 -27
View File
@@ -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)