chore(style): change indentation

This commit is contained in:
Romain Lanz
2017-10-14 23:42:41 +02:00
parent 1e03d2fc1c
commit 4803dac2f5
10 changed files with 215 additions and 207 deletions
+40 -40
View File
@@ -5,62 +5,62 @@ TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
ESX.RegisterServerCallback('esx_weashop:requestDBItems', function(source, cb)
MySQL.Async.fetchAll(
'SELECT * FROM weashops',
{},
function(result)
local shopItems = {}
MySQL.Async.fetchAll(
'SELECT * FROM weashops',
{},
function(result)
for i=1, #result, 1 do
local shopItems = {}
if shopItems[result[i].name] == nil then
shopItems[result[i].name] = {}
end
for i=1, #result, 1 do
table.insert(shopItems[result[i].name], {
name = result[i].item,
price = result[i].price,
label = ESX.GetWeaponLabel(result[i].item)
})
if shopItems[result[i].name] == nil then
shopItems[result[i].name] = {}
end
end
table.insert(shopItems[result[i].name], {
name = result[i].item,
price = result[i].price,
label = ESX.GetWeaponLabel(result[i].item)
})
cb(shopItems)
end
end
)
cb(shopItems)
end
)
end)
RegisterServerEvent('esx_weashop:buyItem')
AddEventHandler('esx_weashop:buyItem', function(itemName, price, zone)
local _source = source
local xPlayer = ESX.GetPlayerFromId(source)
local account = xPlayer.getAccount('black_money')
if zone=="BlackWeashop" then
if account.money >= price then
xPlayer.removeAccountMoney('black_money', price)
xPlayer.addWeapon(itemName, 42)
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ESX.GetWeaponLabel(itemName))
local _source = source
local xPlayer = ESX.GetPlayerFromId(source)
local account = xPlayer.getAccount('black_money')
else
TriggerClientEvent('esx:showNotification', _source, _U('not_enough_black'))
end
if zone=="BlackWeashop" then
if account.money >= price then
else if xPlayer.get('money') >= price then
xPlayer.removeAccountMoney('black_money', price)
xPlayer.addWeapon(itemName, 42)
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ESX.GetWeaponLabel(itemName))
xPlayer.removeMoney(price)
xPlayer.addWeapon(itemName, 42)
else
TriggerClientEvent('esx:showNotification', _source, _U('not_enough_black'))
end
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ESX.GetWeaponLabel(itemName))
else if xPlayer.get('money') >= price then
else
TriggerClientEvent('esx:showNotification', _source, _U('not_enough'))
end
end
xPlayer.removeMoney(price)
xPlayer.addWeapon(itemName, 42)
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ESX.GetWeaponLabel(itemName))
else
TriggerClientEvent('esx:showNotification', _source, _U('not_enough'))
end
end
end)