cfx-server-data icon indicating copy to clipboard operation
cfx-server-data copied to clipboard

Added variable if the player has appeared or not.

Open Micky014 opened this issue 2 years ago • 2 comments

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.

Micky014 avatar Jan 01 '22 21:01 Micky014

You can check this with GetPlayerPed == 0

VIRUXE avatar Jan 05 '22 01:01 VIRUXE

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

jaymo1011 avatar Jan 05 '22 02:01 jaymo1011