Mouse button
#2

pawn Код:
// top of script

new flying[MAX_PLAYERS];

// rest..

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys == KEY_LOOK_BEHIND || newkeys == KEY_SUBMISSION)
    {
        if(flying[playerid] == 0)
        {
            StartFly(playerid);
            flying[playerid] = 1;
        }
       
        else if(flying[playerid] == 1)
        {
            StopFly(playerid);
            flying[playerid] = 0;
        }
    }
}
EDIT: I'm not sure but I don't think the "==" operator works in this case.

pawn Код:
if (newkeys == KEY_LOOK_BEHIND || newkeys == KEY_SUBMISSION)
to

pawn Код:
if (newkeys & KEY_LOOK_BEHIND || newkeys & KEY_SUBMISSION)
Reply


Messages In This Thread
Mouse button - by Ananisiki - 29.04.2014, 22:42
Re: Mouse button - by Dignity - 29.04.2014, 22:44
Re: Mouse button - by Ananisiki - 29.04.2014, 22:57

Forum Jump:


Users browsing this thread: 1 Guest(s)