cfx-server-data
cfx-server-data copied to clipboard
spawnmanager: fixes, improvements + new behavior
Behavior:
- Players will defaulty spawn near 0.0 0.0 instead of being stuck in the loading screen if no spawnpoints have been defined.
This should not create any issues on servers since respawnForced is set to false right after.
Fixes/improvements:
- Replaced some natives with lua functions
- Moved some stuff that might be a cause of "error", like checking spawn.fade before even checking if spawn exists.
- Another check if the spawn model exists.
- Right after NetworkResurrectLocalPlayer the ped is now updated, so other natives should works?
- Removed the stupid request model while checking if the model has been loaded
This is mainly helpful to fix/make things easier if you don't use / forgot spawnpoints.
GetRandomIntInRange() is slower than math.random()
GetRandomIntInRange() is slower than math.random()
Maybe, but 'better' number is more important than performance in this case?