mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Minor adjustments
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ AddEventHandler('esx:playerLoaded', function(playerData)
|
|||||||
ESX.Game.Teleport(playerPed, {
|
ESX.Game.Teleport(playerPed, {
|
||||||
x = playerData.coords.x,
|
x = playerData.coords.x,
|
||||||
y = playerData.coords.y,
|
y = playerData.coords.y,
|
||||||
z = playerData.coords.z + 0.25,
|
z = playerData.coords.z + 0.5,
|
||||||
heading = playerData.coords.heading
|
heading = playerData.coords.heading
|
||||||
}, function()
|
}, function()
|
||||||
isLoadoutLoaded, isDead = true, false
|
isLoadoutLoaded, isDead = true, false
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ ESX.SavePlayer = function(xPlayer, cb)
|
|||||||
['@group'] = xPlayer.getGroup(),
|
['@group'] = xPlayer.getGroup(),
|
||||||
['@loadout'] = json.encode(xPlayer.getLoadout(true)),
|
['@loadout'] = json.encode(xPlayer.getLoadout(true)),
|
||||||
['@position'] = json.encode(xPlayer.getCoords()),
|
['@position'] = json.encode(xPlayer.getCoords()),
|
||||||
['@identifier'] = xPlayer.identifier,
|
['@identifier'] = xPlayer.getIdentifier(),
|
||||||
['@inventory'] = json.encode(xPlayer.getInventory(true))
|
['@inventory'] = json.encode(xPlayer.getInventory(true))
|
||||||
}, function(rowsChanged)
|
}, function(rowsChanged)
|
||||||
cb()
|
cb()
|
||||||
|
|||||||
+6
-6
@@ -131,6 +131,10 @@ function loadESXPlayer(identifier, playerId)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
table.sort(userData.inventory, function(a, b)
|
||||||
|
return a.label < b.label
|
||||||
|
end)
|
||||||
|
|
||||||
-- Group
|
-- Group
|
||||||
if result[1].group then
|
if result[1].group then
|
||||||
userData.group = result[1].group
|
userData.group = result[1].group
|
||||||
@@ -138,10 +142,6 @@ function loadESXPlayer(identifier, playerId)
|
|||||||
userData.group = 'user'
|
userData.group = 'user'
|
||||||
end
|
end
|
||||||
|
|
||||||
table.sort(userData.inventory, function(a, b)
|
|
||||||
return a.label < b.label
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Loadout
|
-- Loadout
|
||||||
if result[1].loadout and result[1].loadout ~= '' then
|
if result[1].loadout and result[1].loadout ~= '' then
|
||||||
local loadout = json.decode(result[1].loadout)
|
local loadout = json.decode(result[1].loadout)
|
||||||
@@ -184,12 +184,12 @@ function loadESXPlayer(identifier, playerId)
|
|||||||
xPlayer.triggerEvent('esx:playerLoaded', {
|
xPlayer.triggerEvent('esx:playerLoaded', {
|
||||||
accounts = xPlayer.getAccounts(),
|
accounts = xPlayer.getAccounts(),
|
||||||
coords = xPlayer.getCoords(),
|
coords = xPlayer.getCoords(),
|
||||||
identifier = xPlayer.identifier,
|
identifier = xPlayer.getIdentifier(),
|
||||||
inventory = xPlayer.getInventory(),
|
inventory = xPlayer.getInventory(),
|
||||||
job = xPlayer.getJob(),
|
job = xPlayer.getJob(),
|
||||||
loadout = xPlayer.getLoadout(),
|
loadout = xPlayer.getLoadout(),
|
||||||
maxWeight = xPlayer.maxWeight,
|
maxWeight = xPlayer.maxWeight,
|
||||||
money = xPlayer.getMoney(),
|
money = xPlayer.getMoney()
|
||||||
})
|
})
|
||||||
|
|
||||||
xPlayer.triggerEvent('esx:createMissingPickups', ESX.Pickups)
|
xPlayer.triggerEvent('esx:createMissingPickups', ESX.Pickups)
|
||||||
|
|||||||
Reference in New Issue
Block a user