Fix typo + weapon labels (you need to recreate the SQL table

This commit is contained in:
Jérémie N'gadi
2017-08-17 10:53:08 +02:00
parent ed0e8af21c
commit 4cbfc6cd72
3 changed files with 7 additions and 23 deletions
+2 -18
View File
@@ -3,22 +3,6 @@ local ItemsLabels = {}
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
AddEventHandler('onMySQLReady', function()
MySQL.Async.fetchAll(
'SELECT * FROM items',
{},
function(result)
for i=1, #result, 1 do
ItemsLabels[result[i].name] = result[i].label
end--
end
)
end)
ESX.RegisterServerCallback('esx_weashop:requestDBItems', function(source, cb)
MySQL.Async.fetchAll(
@@ -61,7 +45,7 @@ AddEventHandler('esx_weashop:buyItem', function(itemName, price, zone)
xPlayer.removeAccountMoney('black_money', price)
xPlayer.addWeapon(itemName, 42)
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ItemsLabels[itemName])
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ESX.GetWeaponLabel(itemName))
else
TriggerClientEvent('esx:showNotification', _source, _U('not_enough_black'))
@@ -72,7 +56,7 @@ AddEventHandler('esx_weashop:buyItem', function(itemName, price, zone)
xPlayer.removeMoney(price)
xPlayer.addWeapon(itemName, 42)
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ItemsLabels[itemName])
TriggerClientEvent('esx:showNotification', _source, _U('buy') .. ESX.GetWeaponLabel(itemName))
else
TriggerClientEvent('esx:showNotification', _source, _U('not_enough'))