27.11.2014, 19:44
I have an idea.
It isn't actually exact to calculate meters that a player run but works
Make some variables
1.player run and walk meters amount
2.player old pos
3.player new pos
For example
Set a timer.
Every 1 second that timer call the callback, ger player position (with loop for all players) and get distance between player position and player old position (with old player pos variable that we defined) and add it to totalplayermeters variable
+= dis………..
And after this, update old player position with new poaition.
Srry i'm with my cellphone and i couldn't give you some examples
Hope i helped.
Good luck
It isn't actually exact to calculate meters that a player run but works
Make some variables
1.player run and walk meters amount
2.player old pos
3.player new pos
For example
pawn Код:
new Float:pTotalmeters[MAX_PLAYERS];
new Float:pOldPos[MAX_PLAYERS][3];
new Float:pNewPos[MAX_PLAYERS][3];
Every 1 second that timer call the callback, ger player position (with loop for all players) and get distance between player position and player old position (with old player pos variable that we defined) and add it to totalplayermeters variable
+= dis………..
And after this, update old player position with new poaition.
Srry i'm with my cellphone and i couldn't give you some examples
Hope i helped.
Good luck