View Single Post
Shlomi
Junior Member
Join Date: Oct 2013
Old 09-25-2014 , 14:42   Re: Checking if a entity is certain weapon
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
Why you would need a check for something that you already know ? It doesn't make sense.
Code:
new const WeaponsInfo[ ] [ Weapons ] =
{
	{ "weapon_deagle", CSW_DEAGLE, "Deagle" },
	{ "weapon_m4a1", CSW_M4A1, "M4A1" },
	{ "weapon_m3", CSW_M3, "Shotgun" },
	{ "weapon_ak47", CSW_AK47, "AK47" },
	{ "weapon_awp", CSW_AWP, "AWP" },
	{ "weapon_scout", CSW_SCOUT, "Scout" }
}

new HamHook:Weapons_Attacks[ sizeof( WeaponsInfo ) ];
Code:
	for( new i = 0 ; i < sizeof( Weapons_Attacks ) ; i++ )
		Weapons_Attacks[ i ] = RegisterHam( Ham_Weapon_PrimaryAttack, WeaponsInfo[ i ] [ ID ], "OnPrimaryAttack", 1 );
now you understand genious?

Last edited by Shlomi; 09-25-2014 at 14:42.
Shlomi is offline