OnPlayerUpdate (Get X,Y,Z,A) Question
#1

Is it better to declare global float variables for players and simply grab the information to fill them in OnPlayerUpdate, instead of having bajillions of 'GetPlayerPos & GetPlayerFacingAngle' happening all over the place all the time in lengthy gamemodes?, I do realise that it's bad practice to put 'lenthy or strenious' code within OnPlayerUpdate.. but I don't think 'GetPlayerPos & GetPlayerFacingAngle' is either of those do you?

eg
PHP код:
new Float:LivePos_x[MAX_PLAYERS],Float:LivePos_y[MAX_PLAYERS],Float:LivePos_z[MAX_PLAYERS],Float:LivePos_a[MAX_PLAYERS];
//OnPlayerUpdate
GetPlayerPos(playeridLivePos_x[playerid], LivePos_y[playerid], LivePos_z[playerid]);
GetPlayerFacingAngle(playeridLivePos_a[playerid]); 
Then just use the LivePos positions where required throughout the gamemode.. yes or no?
Reply
#2

I think you are fine. Also if you want to reduce the frequency of the position getting, you can use a timestamp to do that. I am writing from my phone, so cannot give you an example..
Reply
#3

Hell no
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)