cfx-server-data
cfx-server-data copied to clipboard
Added variable if the player has appeared or not.
A variable that is set to false and at the end of the spawn function is set to true, I have also added an export of a function to check if the player has spawned or not.
You can check this with GetPlayerPed == 0
Why not just listen for the event not even 5 lines above where you've added your implementation? https://github.com/citizenfx/cfx-server-data/blob/66338ec1658b7c404c8f2122eebdf745cad35c11/resources/%5Bmanagers%5D/spawnmanager/spawnmanager.lua#L329-L335
Or if you really just want to check if the player has a ped, why not use the same logic as the resource itself? https://github.com/citizenfx/cfx-server-data/blob/66338ec1658b7c404c8f2122eebdf745cad35c11/resources/%5Bmanagers%5D/spawnmanager/spawnmanager.lua#L349-L351