SA-MP Forums Archive
How can I detect this? - 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 can I detect this? (/showthread.php?tid=78849)



How can I detect this? - Lewwy - 23.05.2009

Hey, how can I detect if a player is holding a certain weapon. For instance, I want to check if a player is holding an M4 rifle, not that he has one in his inventory.


Re: How can I detect this? - GanG$Ta - 23.05.2009

Код:
if(GetPlayerWeapon(playerid) == 31) //M4
{

}



Re: How can I detect this? - Lewwy - 23.05.2009

I know of that function, and never tested to see if that meant it would be in his hand. Is that for "in the hand" or "in the pocket"?


Re: How can I detect this? - GanG$Ta - 23.05.2009

in the hand.


Re: How can I detect this? - Lewwy - 23.05.2009

Alright, cheers. I may get back to you otherwise.