SA-MP Forums Archive
How to detect? - 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: How to detect? (/showthread.php?tid=582591)



How to detect? - Midzi - 21.07.2015

Hello.

I have a question.. Have to detect that player throw grenade?
OnPlayerWeaponShot support only bullet weapons.


AW: How to detect? - Macronix - 21.07.2015

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	new weaponid = GetPlayerWeapon(playerid);
	if(newkeys & KEY_FIRE && weaponid == 16) // ID 16 for Grenade
	{
	   SendClientMessage(playerid, -1, "Grenade has been thrown");
	}
        return 1;
}



Re: How to detect? - Midzi - 21.07.2015

Lel.. thanks.