perf: updating last location

This commit is contained in:
Andyyy7666 committed 2023-01-05 17:05:50 +01:00
1 parent 906383bbd9
commit 5242cf289d
2 files changed
+3 -15

No files matched your search

+3 -1
View File
@@ -83,7 +83,9 @@ AddEventHandler("playerDropped", function()
local player = source
local character = NDCore.Players[player]
if character then
NDCore.Functions.UpdateLastLocation(character.id, character.lastLocation)
local ped = GetPlayerPed(player)
local lastLocation = GetEntityCoords(ped)
NDCore.Functions.UpdateLastLocation(character.id, {x = lastLocation.x, y = lastLocation.y, z = lastLocation.z})
end
TriggerEvent("ND:characterUnloaded", player, character)
character = nil