SA-MP Forums Archive
IsPlayerMoving - Would this work? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: IsPlayerMoving - Would this work? (/showthread.php?tid=497613)



IsPlayerMoving - Would this work? - Phil_Cutcliffe - 27.02.2014

pawn Код:
stock bool:IsPlayerMoving(playerid)
{
    new Float:Velocity[3];
    GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]);
    if(Velocity[0] == 0 && Velocity[1] == 0 && Velocity[2] == 0) return false;
    return true;
}



Respuesta: IsPlayerMoving - Would this work? - Stront - 27.02.2014

Maybe. Why haven't you tried it?
I also recommend you to classfield Velocity with playerid array, not to mix'em.

new Float:Velocity[MAX_PLAYERS][3];
...


Re: Respuesta: IsPlayerMoving - Would this work? - Phil_Cutcliffe - 27.02.2014

Quote:
Originally Posted by Stront
Посмотреть сообщение
Maybe. Why haven't you tried it?
I also recommend you to classfield Velocity with playerid array, not to mix'em.

new Float:Velocity[MAX_PLAYERS][3];
...
Yeah I've tried it and it works nicely. Thanks for the suggestion also.