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
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
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
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).