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(floatsquare(Pos[0])+floatsquare(Pos[1])+floatsquare(Pos[2]))-floatsqroot(floatsquare(GetPVarFloat(i, "OLDX"))+floatsquare(GetPVarFloat(i, "OLDY"))+floatsquare(GetPVarFloat(i, "OLDZ"))));
- 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