Improved saving loadouts (see desc)

- Only save weapon components if needed, wont save default clip anymore, and if no other component is available then its not saved at all

- Tint index not stored if not above 0
- Weapon label not saved in database since its useless
- Validate weapon on player load
This commit is contained in:
ElPumpo
2020-03-01 10:54:03 +01:00
parent 79d53a5550
commit 4d9af4e1ab
3 changed files with 52 additions and 16 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ ESX.SavePlayer = function(xPlayer, cb)
MySQL.Async.execute('UPDATE users SET job = @job, job_grade = @job_grade, loadout = @loadout, position = @position, inventory = @inventory WHERE identifier = @identifier', {
['@job'] = xPlayer.job.name,
['@job_grade'] = xPlayer.job.grade,
['@loadout'] = json.encode(xPlayer.getLoadout()),
['@loadout'] = json.encode(xPlayer.getLoadout(true)),
['@position'] = json.encode(xPlayer.getCoords()),
['@identifier'] = xPlayer.identifier,
['@inventory'] = json.encode(xPlayer.getInventory(true))