Added fivem appearance

This commit is contained in:
Andyyy7666
2022-08-09 00:53:35 +02:00
parent 6d693ff7f3
commit 8681f824b6
5 changed files with 287 additions and 29 deletions

View File

@@ -77,7 +77,11 @@ end)
-- Remove player from NDCore.Players table when they leave.
AddEventHandler("playerDropped", function()
local player = source
NDCore.Players[player] = nil
local character = NDCore.Players[player]
if character then
NDCore.Functions.UpdateLastLocation(character.id, character.lastLocation)
end
character = nil
end)
-- Update the characters clothes.

View File

@@ -7,4 +7,17 @@ NDCore.Config = config
function GetCoreObject()
return NDCore
end
end
CreateThread(function()
while true do
Wait(30000)
for player, playerInfo in pairs(NDCore.Players) do
local ped = GetPlayerPed(player)
if DoesEntityExist(ped) then
local lastLocation = GetEntityCoords(ped)
playerInfo.lastLocation = {x = lastLocation.x, y = lastLocation.y, z = lastLocation.z}
end
end
end
end)