10.08.2012, 14:40
Any tutorial how to create animations and to make them stop using the Spacebar?
//To stop animation
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED( KEY_SPRINT ))
if(GetPlayerAnimationIndex(playerid)!=0)
ClearAnimations(playerid);
return 1;
}
if(strcmp(cmdtext, "/arrest", true) == 0)
{
if(GetPlayerState(playerid) == 1)
{
ApplyAnimation(playerid, "PED", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
}
return 1;
}