View Single Post
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 09-11-2019 , 12:40   Re: Golden weapons for vip
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Only that ALL 19 of those functions are called EACH TIME you shoot a bullet and every single check is executed 19 times + you're checking 19 times if the player has the *hardcoded* admin flag.
I guess he tried to do the same as this:

Code:
new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
			"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
			"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
			"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
			"weapon_ak47", "weapon_knife", "weapon_p90" }

public plugin_init()
{
	for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
		if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "fw_Item_Deploy_Post", 1)
}
But instead of using Ham_Item_Deploy, he thought that it would be a good idea to use CurWeapon event.

P.S: There's more code in this obviously, but the point is just registering the event.

Last edited by Smilex_Gamer; 09-11-2019 at 12:42.
Smilex_Gamer is offline