SA-MP Forums Archive
Is player pressed double keys - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Is player pressed double keys (/showthread.php?tid=562541)



Is player pressed double keys - Banditukas - 09.02.2015

Hi,

I want to make when player press two keys just then allow.


Re: Is player pressed double keys - CalvinC - 09.02.2015

Use this:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_1) && (newkeys & KEY_2))
    {
        // Code
    }
    return 1;
}
Here's a list of all keys: https://sampwiki.blast.hk/wiki/Keys


Re: Is player pressed double keys - Vince - 09.02.2015

Not entirely correct, see here: https://sampwiki.blast.hk/wiki/OnPlayerK..._multiple_keys