Guest User

Untitled

a guest
Jun 22nd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.57 KB | None | 0 0
  1.  
  2.  
  3. public UpdatePlayerPos()
  4. {
  5.     new Float:Pos[3];
  6.     foreach(Player, i)
  7.     {
  8.         if(!IsPlayerConnected(i)) continue;
  9.         GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  10.         if(GetPlayerState(i) == PLAYER_STATE_ONFOOT)
  11.         {
  12.             PlayerInfo[i][pDistance] = floatround(floatsqroot(floatsquare(Pos[0])+floatsquare(Pos[1])+floatsquare(Pos[2]))-floatsqroot(floatsquare(GetPVarFloat(i, "OLDX"))+floatsquare(GetPVarFloat(i, "OLDY"))+floatsquare(GetPVarFloat(i, "OLDZ"))));
  13.             SetPVarFloat(i, "OLDX", Pos[0]);
  14.             SetPVarFloat(i, "OLDY", Pos[1]);
  15.             SetPVarFloat(i, "OLDZ", Pos[2]);
  16.         }
  17.     }
  18.     return 1;
  19. }
Add Comment
Please, Sign In to add comment