How to check if player is crouching?
#2

Something like this;

pawn Код:
new bool: crouching[MAX_PLAYERS];

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_CROUCH)
    {
        crouching[playerid] = true;
    }

    if(newkeys & KEY_SPRINT) || (newkeys & KEY_CROUCH) && (newkeys & KEY_FIRE))
    {
        if(crouching[playerid])
        {
            crouching[playerid] = false;
        }
    }

    return 1;
}
If anyone else knows a more efficient way, please reply.
Reply


Messages In This Thread
How to check if player is crouching? - by Mavis100 - 13.05.2014, 00:53
Re: How to check if player is crouching? - by Dignity - 13.05.2014, 01:05
Re: How to check if player is crouching? - by ChuckyBabe - 13.05.2014, 01:09
Re: How to check if player is crouching? - by Mavis100 - 13.05.2014, 01:16
Re: How to check if player is crouching? - by Corekt - 13.05.2014, 01:37

Forum Jump:


Users browsing this thread: 1 Guest(s)