Add xPlayer.getMaxWeight() (#559)

* Add xPlayer.getMaxWeight()

Add ability to read current maximum weight for player

* Remove the tab indent
This commit is contained in:
MohamedAmrMahdy
2020-03-11 10:53:57 +02:00
committed by GitHub
parent a8255ce6e3
commit e712c0158d
+4
View File
@@ -265,6 +265,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
return inventoryWeight
end
self.getMaxWeight = function()
return self.maxWeight
end
self.canCarryItem = function(name, count)
local currentWeight, itemWeight = self.getWeight(), ESX.Items[name].weight
local newWeight = currentWeight + (itemWeight * count)