Issues with SPECIAL_ACTION_CUFFED
#1

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
Reply
#2

3. You can punch players when you are cuffed.
Reply
#3

then use

pawn Code:
TogglePlayerControllable(playerid, false);
Reply
#4

Quote:
Originally Posted by Skribblez
View Post
then use

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

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
Reply
#6

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.
Reply
#7

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);
    }
}
Reply
#8

ClearAnimations instead of TogglePlayerControllable, my apologies
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)