Float health and altitude won't change.
#9

Quote:
Originally Posted by Vince
Посмотреть сообщение
There's nothing wrong with using OnPlayerUpdate if you know how to use it. This callback's main purpose is to provide a system to create your own custom callbacks like OnPlayerHealthChange, OnPlayerWeaponChange and things like that. Don't use it for things that the server controls (score and such) and don't use it as a general purpose timer.

I would probably move the "health" thingy to a separate function and call it from OnPlayerStateChange, OnVehicleDamageStatusUpdate and OnPlayerWeaponShot because most vehicle health changes occur due to collisions or bullets.

For a smooth experience you need at least 24 updates per second or the equivalent of a 40-ish milliseconds timer so speed and altitude can probably stay in OPU. They're only 5 lines of code which shouldn't cause any serious issues. Just make sure that your "get speed" function is optimized, i.e. use the VectorSize version, not the outdated and slow floatsqroot version.
There goes. Lesson learned. It won't be necessary to offend.
Reply


Messages In This Thread
Float health and altitude won't change. - by NealPeteros - 28.04.2017, 12:02
Re: Float health and altitude won't change. - by Logic_ - 28.04.2017, 12:15
Re: Float health and altitude won't change. - by NealPeteros - 28.04.2017, 12:18
Re: Float health and altitude won't change. - by Logic_ - 28.04.2017, 12:20
Re: Float health and altitude won't change. - by NealPeteros - 28.04.2017, 12:22
Re: Float health and altitude won't change. - by Logic_ - 28.04.2017, 12:26
Re: Float health and altitude won't change. - by NealPeteros - 28.04.2017, 13:27
Re: Float health and altitude won't change. - by Vince - 28.04.2017, 15:18
Re: Float health and altitude won't change. - by NealPeteros - 28.04.2017, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)