mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 17:58:54 +00:00
Fix typo + weapon labels (you need to recreate the SQL table
This commit is contained in:
+2
-1
@@ -16,7 +16,8 @@ Config.Zones = {
|
||||
|
||||
}
|
||||
},
|
||||
blackweashop = {
|
||||
|
||||
BlackWeashop = {
|
||||
legal=1,
|
||||
Items = {},
|
||||
Pos = {
|
||||
|
||||
+3
-4
@@ -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
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user