SA-MP Forums Archive
key fire - 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: key fire (/showthread.php?tid=618259)



key fire - MerryDeer - 03.10.2016

Hi,

How to detect all key fire? key_Fire only detect when press key_fire, but i want all keys, when player could shoot


Re: key fire - GoldenLion - 03.10.2016

KEY_FIRE is when a player presses a key used to shoot, it doesn't matter what key it is, it's still KEY_FIRE if the key makes you shoot... Eh, you could just test instead of asking every single small thing here...


Re: key fire - MerryDeer - 03.10.2016

So with getplayerkeys, i need just KEY_FIRE? but i test i prints, when i run and shoot, when c and shoot, i always get different keys


Re: key fire - Vince - 03.10.2016

Read this: https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Specifically the part about "how NOT to check for a key".


Re: key fire - MerryDeer - 03.10.2016

So, getplayerkeys(key,left,right);

if( key & KEY_FIRE )
{

}

?