Use
pawn Код:
public OnPlayerUpdate(playerid)
{
if(GetPlayerAnimationIndex(playerid))
{
new animlib[32];
new animname[32];
new msg[128];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
format(msg, 128, "Running anim: %s %s", animlib, animname);
SendClientMessage(playerid, 0xFFFFFFFF, msg);
}
return 1;
}
and run, get the animation name and do this:
pawn Код:
#define RUNANIM_LIB "RUNNING"
#define RUNANIM_NAME "RUN" // Change these obviously, because they're not correct.
stock IsPlayerRunning ( playerid )
{
new animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if( strcmp( animlib, RUNANIM_LIB, false ) && strcmp( animname, RUNANIM_NAME, false ) )
{
return true;
}
else return false;
}
Sorry about the indentation, school computers.. blah. That's my guess on how to do it; otherwise, check out IsPlayerSwimming and modify that to your needs.