mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 01:38:52 +00:00
Implemented xPlayer.setLastPosition and fixed saving coords
This commit is contained in:
@@ -208,6 +208,10 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l
|
||||
return self.lastPosition
|
||||
end
|
||||
|
||||
self.setLastPosition = function(position)
|
||||
self.lastPosition = position
|
||||
end
|
||||
|
||||
self.getMissingAccounts = function(cb)
|
||||
MySQL.Async.fetchAll('SELECT * FROM `user_accounts` WHERE `identifier` = @identifier', {
|
||||
['@identifier'] = self.getIdentifier()
|
||||
|
||||
@@ -38,7 +38,7 @@ end
|
||||
|
||||
ESX.SavePlayer = function(xPlayer, cb)
|
||||
local asyncTasks = {}
|
||||
xPlayer.lastPosition = xPlayer.get('coords')
|
||||
xPlayer.setLastPosition(xPlayer.getCoords())
|
||||
|
||||
-- User accounts
|
||||
for i=1, #xPlayer.accounts, 1 do
|
||||
|
||||
+1
-1
@@ -255,7 +255,7 @@ end)
|
||||
RegisterServerEvent('esx:updateLastPosition')
|
||||
AddEventHandler('esx:updateLastPosition', function(position)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
xPlayer.lastPosition = position
|
||||
xPlayer.setLastPosition(position)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx:giveInventoryItem')
|
||||
|
||||
Reference in New Issue
Block a user