Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public UpdatePlayerPos()
- {
- new Float:Pos[3];
- foreach(Player, i)
- {
- if(!IsPlayerConnected(i)) continue;
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- if(GetPlayerState(i) == PLAYER_STATE_ONFOOT)
- {
- PlayerInfo[i][pDistance] = floatround(floatsqroot(GetPVarFloat(i, "OLDX") -Pos[0]) * (GetPVarFloat(i, "OLDX") -Pos[0]) + (GetPVarFloat(i, "OLDY") -Pos[1]) * (GetPVarFloat(i, "OLDY") -Pos[1]) + (GetPVarFloat(i, "OLDZ") -Pos[2]) * (GetPVarFloat(i, "OLDZ") -Pos[2]), floatround_floor);
- SetPVarFloat(i, "OLDX", Pos[0]);
- SetPVarFloat(i, "OLDY", Pos[1]);
- SetPVarFloat(i, "OLDZ", Pos[2]);
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment