Breaking changes: implemented global weight inventory system, read description before updating!

- Fixed #256
- Implements #173

__NO OFFICIAL ESX SCRIPT WILL WORK WITH THIS AT THE MOMENT__

This commit will break your entire ESX if you dont use the new SQL format, follow the new one if you want it all to work properly.

Scripts using `item.limit` will break too, instead use `xPlayer.canCarryItem(item, count)`
This commit is contained in:
ElPumpo
2019-10-13 20:56:09 +02:00
parent 130df3f18f
commit 145f8ebe75
16 changed files with 723 additions and 967 deletions
+16 -16
View File
@@ -1,14 +1,14 @@
ESX = {}
ESX.Players = {}
ESX = {}
ESX.Players = {}
ESX.UsableItemsCallbacks = {}
ESX.Items = {}
ESX.ServerCallbacks = {}
ESX.TimeoutCount = -1
ESX.CancelledTimeouts = {}
ESX.LastPlayerData = {}
ESX.Pickups = {}
ESX.PickupId = 0
ESX.Jobs = {}
ESX.Items = {}
ESX.ServerCallbacks = {}
ESX.TimeoutCount = -1
ESX.CancelledTimeouts = {}
ESX.LastPlayerData = {}
ESX.Pickups = {}
ESX.PickupId = 0
ESX.Jobs = {}
AddEventHandler('esx:getSharedObject', function(cb)
cb(ESX)
@@ -20,12 +20,12 @@ end
MySQL.ready(function()
MySQL.Async.fetchAll('SELECT * FROM items', {}, function(result)
for i=1, #result, 1 do
ESX.Items[result[i].name] = {
label = result[i].label,
limit = result[i].limit,
rare = (result[i].rare == 1 and true or false),
canRemove = (result[i].can_remove == 1 and true or false),
for k,v in ipairs(result) do
ESX.Items[v.name] = {
label = v.label,
weight = v.weight,
rare = v.rare,
canRemove = v.can_remove
}
end
end)