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 -1
View File
@@ -16,7 +16,8 @@ Config.Zones = {
}
},
blackweashop = {
BlackWeashop = {
legal=1,
Items = {},
Pos = {
+3 -4
View File
@@ -6,12 +6,11 @@ CREATE TABLE `weashops` (
`name` varchar(255) NOT NULL,
`item` varchar(255) NOT NULL,
`price` int(11) NOT NULL,
`label` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `weashops` (name, item, price, label) VALUES
('GunShop','WEAPON_Pistol',300, 'pistol'),
('blackweashop','WEAPON_Pistol',500, 'pistol')
INSERT INTO `weashops` (name, item, price) VALUES
('GunShop','WEAPON_PISTOL',300),
('BlackWeashop','WEAPON_PISTOL',500)
;
+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'))