Any way to disable player jumping if anything?
#1

I currently have a function witch does blah blah.. and i need to way if this fuction is active, like uhm lets say the player under the effect of animation to disable jumping. (but i need the animation run anyways)
Reply
#2

The only way to do it is to reset the special action on the jump key (KEY_JUMP). This will stop you from sprinting if you press jump while you're sprinting, however.
Reply
#3

You can do something like this,

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_JUMP)
    {
         if(Disabled[playerid])
         {
            new Float: pos[3];
            GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            ClearAnimations(playerid);
            return 1;
        }
   }
return 1;
}
Note it would clear the running animation, - how-ever you could apply a running animation in place using ApplyAnimation for a few seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)