Mouse button
#1

How i can do like if the fly is 0, and player press mmb then he will fly, if he already on fly mode he will be stop from flymode, how


pawn Код:
if (newkeys == KEY_LOOK_BEHIND || newkeys == KEY_SUBMISSION)
    {
        StartFly(playerid);
    }
Reply
#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
#3

ty +rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)