How create IsPlayerMoving or not?
#1

Hi, i have a question. How create IsPlayerMoving or not. I am trying so
Код:
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 true;
	return false;
}
and check
Код:
if(IsPlayerMoving(playerid))
{
	
}
else
{
	
}
But, i getting variables or moneys. Where is the problem?
Reply
#2

The problem is that you say the player is moving when the velocity is zero.


This forum requires that you wait 120 seconds between posts. Please try again in 18 seconds.
Reply
#3

Can you give me example?
Reply
#4

You put the returns the wrong way around.

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;
}
Reply
#5

Thanks. ;]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)