From cbc5113d7b30afbac743a33c7225bcd2fbaa64bb Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 2 Nov 2019 11:01:26 +0100 Subject: [PATCH] Minor statement fix --- server/main.lua | 50 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/server/main.lua b/server/main.lua index 6fd3fbf1..772fbb3a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -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)