How do you say "or" with pawn? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How do you say "or" with pawn? (
/showthread.php?tid=259773)
How do you say "or" with pawn? -
[RVRP]Tyler - 05.06.2011
I know this is probably the most humiliating question you have ever seen, but I'm seriously drawing a blank. It's been about 9 months since I last scripted and I'm just getting back into it.
Basically, I want to check if they press KEY_SPRINT or KEY_FIRE.
Код:
if(newkeys == KEY_SPRINT)
{
SendClientMessage(playerid, COLOR_WHITE, "Hi.");
}
Re: How do you say "or" with pawn? -
Gamer_Z - 05.06.2011
if(newkeys & KEY_xxx || newkeys & KEY_xxx2) { dunno why var & name but that's how i see it in most cases, usinng onplayerkeys is something I do almost NEVER xD
Re: How do you say "or" with pawn? -
Laronic - 05.06.2011
pawn Код:
if(newkeys == KEY_SPRINT || newkeys == KEY_FIRE)
{
SendClientMessage(playerid, COLOR_WHITE, "Hi.");
}
&& = AND
|| = OR
Re: How do you say "or" with pawn? -
linuxthefish - 05.06.2011
Fuck me.