SA-MP Forums Archive
Check if player is in the Crouching animation. - 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: Check if player is in the Crouching animation. (/showthread.php?tid=406063)



Check if player is in the Crouching animation. - Rick_Koning - 08.01.2013

Hello,

I'd like to peform an action, this action depends on if the player is currently standing or crouching.
How do I check if he's in the crouching animation?

It's not about hitting the key, it's just if he's in the animation ( Shooting an M4 from crouching for example ).

Thanks


Re: Check if player is in the Crouching animation. - Dinnozor - 08.01.2013

GetPlayerSpecialAction(playerid)==1


Re: Check if player is in the Crouching animation. - dannyk0ed - 08.01.2013

pawn Код:
if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "   You must be on foot");



Re: Check if player is in the Crouching animation. - Rick_Koning - 08.01.2013

Working now, although I'm stuck with this:
After it peforms the animation, the character just stands up. While it's supposed to crouch.

Anyone?

Код:
	            
if (GetPlayerSpecialAction(playerid)== SPECIAL_ACTION_DUCK)
{
     ApplyAnimation(playerid,"COLT45","colt45_crouchreload",10.1,0,0,0,0,0,0);
     SendClientMessage(playerid,red,"Go back in prone animation");
     SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DUCK);
}



Re: Check if player is in the Crouching animation. - mastermax7777 - 08.01.2013

SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DUC K); ->> INVALID

U CANT MAKE THE PLAYER CROUCH!! READ THE WIKI

SPECIAL_ACTION_DUCK *
(*) These Special Actions cannot be set.