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

spawnmanager: fixes, improvements + new behavior

Open PichotM opened this issue 6 years ago • 2 comments

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.

PichotM avatar Aug 14 '19 01:08 PichotM

GetRandomIntInRange() is slower than math.random()

smallo92 avatar Aug 14 '19 12:08 smallo92

GetRandomIntInRange() is slower than math.random()

Maybe, but 'better' number is more important than performance in this case?

warxander avatar Aug 14 '19 12:08 warxander