Raised This Month: $ Target: $400
 0% 

Whats wrong with this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 07-10-2007 , 13:55   Re: Whats wrong with this?
Reply With Quote #1

No idea what "cache strings" means ;)
@stupok69, if you could rewrite it to make it not "awful", I'd greatly appreciate it ;)
iHaxor.Stan is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-10-2007 , 14:21   Re: Whats wrong with this?
Reply With Quote #2

Tested and works.

Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

enum
{
	custom_weapon_mp5navy,
	custom_weapon_tmp,
	custom_weapon_p90,
	custom_weapon_mac10,
	custom_weapon_ak47,
	custom_weapon_sg552,
	custom_weapon_m4a1,
	custom_weapon_aug,
	custom_weapon_scout,
	custom_weapon_g3sg1,
	custom_weapon_awp,
	custom_weapon_m3,
	custom_weapon_xm1014,
	custom_weapon_m249,
	custom_weapon_flashbang,
	custom_weapon_hegrenade,
	custom_item_assaultsuit,
	custom_item_kevlar,
	custom_weapon_smokegrenade,
	custom_weapon_deagle,
	custom_weapon_elite,
	custom_weapon_famas,
	custom_weapon_fiveseven,
	custom_weapon_galil,
	custom_weapon_glock18,
	custom_weapon_p228,
	custom_weapon_sg550,
	custom_weapon_ump45,
	custom_weapon_usp,
	LAST_ENTRY
}

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

public plugin_init()
{
	register_plugin("Super-Advanced Weapon Giver", "1.0", "Hawk-Stan")
	
	register_clcmd("say /all", "give_all")
	register_clcmd("say /sniper", "give_sniper")
	register_clcmd("say /rambo", "give_rambo")
	register_clcmd("say /assault", "give_assault")
	register_clcmd("say", "handle_say")
}

public handle_say(id)
{
	if (!is_user_alive(id))
		return PLUGIN_HANDLED
	
	new arg1[32]
	read_argv(1, arg1, 31)
	
	if(!equali(arg1, "/give", 5))
		return PLUGIN_HANDLED
	
	new weapon[32]
	parse(arg1, arg1, 31, weapon, 31)
	
	for(new i = 0; i < LAST_ENTRY; i++)
	{
		if(containi(weapon_name[i], weapon) != -1)
		{
			give_item(id, weapon_name[i])
		}
	}
	
	return PLUGIN_HANDLED
}

public give_all(id)
{ 
	if (!is_user_alive(id))
		return PLUGIN_HANDLED
	
	
	for(new i = 0; i < LAST_ENTRY; i++)
	{
		give_item(id, weapon_name[i])
	}
	
	return PLUGIN_HANDLED
}

public give_sniper(id)
{ 
	if (!is_user_alive(id))
		return PLUGIN_HANDLED
	
	give_item(id, weapon_name[custom_weapon_awp])
	give_item(id, weapon_name[custom_weapon_scout])
	give_item(id, weapon_name[custom_weapon_g3sg1])
	give_item(id, weapon_name[custom_weapon_hegrenade])
	give_item(id, weapon_name[custom_weapon_smokegrenade])
	give_item(id, weapon_name[custom_weapon_flashbang])
	give_item(id, weapon_name[custom_item_assaultsuit])
	give_item(id, weapon_name[custom_weapon_deagle])
	give_item(id, weapon_name[custom_weapon_usp])
	
	return PLUGIN_HANDLED
}

public give_rambo(id)
{ 
	if (!is_user_alive(id))
		return PLUGIN_HANDLED
	
	give_item(id, weapon_name[custom_weapon_m249])
	give_item(id, weapon_name[custom_weapon_xm1014])
	give_item(id, weapon_name[custom_weapon_m3])
	give_item(id, weapon_name[custom_weapon_hegrenade])
	give_item(id, weapon_name[custom_weapon_flashbang])
	give_item(id, weapon_name[custom_weapon_smokegrenade])
	give_item(id, weapon_name[custom_item_assaultsuit])
	give_item(id, weapon_name[custom_weapon_elite])
	give_item(id, weapon_name[custom_weapon_p228])
	
	return PLUGIN_HANDLED
}


public give_assault(id)
{ 
	if (!is_user_alive(id))
		return PLUGIN_HANDLED
	
	give_item(id, weapon_name[custom_weapon_m4a1])
	give_item(id, weapon_name[custom_weapon_ak47])
	give_item(id, weapon_name[custom_weapon_aug])
	give_item(id, weapon_name[custom_weapon_sg550])
	give_item(id, weapon_name[custom_weapon_hegrenade])
	give_item(id, weapon_name[custom_weapon_smokegrenade])
	give_item(id, weapon_name[custom_weapon_flashbang])
	give_item(id, weapon_name[custom_weapon_p228])
	give_item(id, weapon_name[custom_weapon_deagle])
	give_item(id, weapon_name[custom_item_assaultsuit])
	
	return PLUGIN_HANDLED
}
stupok is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode