Allow peds that have a specific health (ped whitelisting)
NOTICE: This will stop the spawning of ALL peds. If you have any script that spawns peds, or have AI turned on this will stop said peds/AI from spawning!
If your server spawns peds, that you do not want to despawn in the script that creates that ped use SetEntityHealth() right after the ped is spawned, and set its heath to the defined âhealthWhitelistâ. This will allow the ped to stay.
If you need further help implementing this let me know.
You can now allow specific peds by setting their health to the defined health in client.lua and server.lua.
For Instance:
If your server has a mechanic ped, that you do not want to despawn in the script that creates that ped use SetEntityHealth() right after the ped is spawned, and set its heath to the defined âhealthWhitelistâ. This will allow the ped to stay.
If you need further help implementing this let me know.
This one done to ensure deletion of the entity, there were times in testing where the entity would not delete even after canceling the event feel free to remove it, however as stated you may have times where it does not delete, for whatever reason.