SA-MP Forums Archive
Issues with SPECIAL_ACTION_CUFFED - 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: Issues with SPECIAL_ACTION_CUFFED (/showthread.php?tid=329100)



Issues with SPECIAL_ACTION_CUFFED - MP2 - 27.03.2012

1. Does not work on CJ skin
2. Players that are paused sometimes are in the 'cuffed' animation, OR, when a player returns from pausing and another player is paused, the other player is in cuffs, not sure which


Re: Issues with SPECIAL_ACTION_CUFFED - IstuntmanI - 27.03.2012

3. You can punch players when you are cuffed.


Re: Issues with SPECIAL_ACTION_CUFFED - Skribblez - 27.03.2012

then use

pawn Code:
TogglePlayerControllable(playerid, false);



Re: Issues with SPECIAL_ACTION_CUFFED - Dripac - 27.03.2012

Quote:
Originally Posted by Skribblez
View Post
then use

pawn Code:
TogglePlayerControllable(playerid, false);
You can still punch them


Respuesta: Re: Issues with SPECIAL_ACTION_CUFFED - Vladeksh - 28.03.2012

Quote:
Originally Posted by costel_nistor96
View Post
3. You can punch players when you are cuffed.
Try this
pawn Code:
//OnPlayerKeyStateChange
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
{
    if(PRESSED(KEY_FIRE) || PRESSED(KEY_SECONDARY_ATTACK | 128)) TogglePlayerControllable(playerid, 1);
}
https://sampwiki.blast.hk/wiki/OnPlayerK...pressing_a_key


Re: Issues with SPECIAL_ACTION_CUFFED - MP2 - 28.03.2012

That is a bad example. This works properly:

pawn Code:
if(pFrozen[playerid] && (keys & KEY_JUMP || keys & KEY_FIRE || updown != 0 || leftright != 0)) return 0;
Just set pFrozen to 1 when you freeze them, and 0 when unfrozen.


Re: Issues with SPECIAL_ACTION_CUFFED - OKStyle - 28.03.2012

Or more powerful:
pawn Code:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
{
    if(PRESSED(KEY_FIRE) || PRESSED(KEY_SECONDARY_ATTACK | 128))
    {
         ClearAnimations(playerid);
         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
    }
}



Respuesta: Issues with SPECIAL_ACTION_CUFFED - Vladeksh - 28.03.2012

ClearAnimations instead of TogglePlayerControllable, my apologies


Re: Issues with SPECIAL_ACTION_CUFFED - MP2 - 28.03.2012

Well mine is simply to stop the punching/running/jumping animations syncing with other players while toggled uncontrollable, but for preventing punching, yes, ClearAnimations().


AW: Re: Issues with SPECIAL_ACTION_CUFFED - FufLa - 28.03.2012

Quote:
Originally Posted by MP2
View Post
That is a bad example. This works properly:

pawn Code:
if(pFrozen[playerid] && (keys & KEY_JUMP || keys & KEY_FIRE || updown != 0 || leftright != 0)) return 0;
Just set pFrozen to 1 when you freeze them, and 0 when unfrozen.
This only works properly if the user is really frozen. If someone just uses that snippet without freezing someone it's going to go really bad (the guy will simply hold the fire key and run around while others see him standing at one point -> desynced).