ApplyAnimation(playerid, "PED", "HANDSUP", 4.1, 0, 0, 0, 1, 0, 1);
Take a look at this:
https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex |
new lib[32]; new index[32]; if(GetPlayerAnimationIndex(playerid)) GetAnimationName(GetPlayerAnimationIndex(playerid),lib,32,index,32); if(strcmp(lib,"PED") == 0 && strcmp(index,"HANDSUP") == 0) { //player will be cuffed }
#include <a_samp>
bool:HasAnimationApplied(playerid, animlib[], animname[])
{
new l_animlib[32];
new l_animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),l_animlib,32,l_animname,32);
if (strcmp(animlib, l_animlib, true) == 0 && strcmp(animname, l_animname, true) == 0)
return true;
return false;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
else if (strcmp("/up", cmdtext, true, 3) == 0)
{
ApplyAnimation(playerid, "PED", "HANDSUP", 4.1, 0, 0, 0, 1, 0, 1);
return 1;
}
else if (strcmp("/down", cmdtext, true, 5) == 0)
{
ClearAnimations(playerid);
return 1;
}
else if (strcmp("/isup", cmdtext, true, 5) == 0 )
{
if (HasAnimationApplied(playerid, "PED", "HANDSUP"))
SendClientMessage(playerid, 0xFFFFFFFF, "HANDSUP");
else
SendClientMessage(playerid, 0xFFFFFFFF, "HANDSDOWN");
return 1;
}
return 0;
}