Check if player has the weapon
#4

Quote:
Originally Posted by K0P
Посмотреть сообщение
Код:
if(GetPlayerWeapon(playerid) != yourweaponid)
{
    ...here do your stuff
}
It only checks what weapon player is holding.

Quote:
Originally Posted by VVWVV
Посмотреть сообщение
Use this function:
Код:
stock
	IsPlayerUsingWeapon(playerid, _weaponid)
{ // Author: VVWVV
	const MAX_WEAPONS_SLOTS = 13;
	static ammo, weaponid;
	for (new i; i != MAX_WEAPONS_SLOTS; i++)
	{
		if (GetPlayerWeaponData(playerid,
			i, weaponid, ammo) == 0)
			return 0;
		if (weaponid == _weaponid)
			return 1;
	}
	return 0;
}
Thanks, it works, but I just realized that I already have that in my script lol, u earned a rep tho
Reply


Messages In This Thread
Check if player has the weapon - by GoldenLion - 11.07.2016, 10:16
Re: Check if player has the weapon - by K0P - 11.07.2016, 10:18
Re: Check if player has the weapon - by VVWVV - 11.07.2016, 10:35
Re: Check if player has the weapon - by GoldenLion - 11.07.2016, 14:27

Forum Jump:


Users browsing this thread: 1 Guest(s)