[ create a new paste ] login | about

Link: http://codepad.org/82YX49wQ    [ raw code | fork ]

Raheem - C, pasted on Aug 4:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

new money

public plugin_init()
{
	register_plugin("VIP Menu", "1.0", "Abed")
	register_concmd( "svip_menu","vipmenu" );
	RegisterHam(Ham_Spawn, "player", "spwan", 1)
}

/*---------Happy Hour Code By Raheem--------*/

public spwan(id)
{
	new time[3]
	get_time("%H", time, charsmax(time))
	
	new flags = read_flags("t")
	
	if( (10 > (str_to_num(time)) >= 9) && !(get_user_flags(id) & ADMIN_LEVEL_H)) //Change time from here (9 Start - 10 End)
	{
		set_user_flags(id,flags)
	}
	else
	{
		return;
	}
}

/*-----------------End HERE-----------------*/

public vipmenu( id )
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_H))
	{
		ChatColor(id, "!g[AMXX] You Have no Access to Use The Super Vip menu.");
		
		return PLUGIN_HANDLED;
	}

	new menu = menu_create( "\wVIP Menu:", "menu_handler" );
	menu_additem( menu, "\wJanus-3 \r[\y8000\r$]", "", 0 );
	menu_additem( menu, "\wThanatos-7\r[3000\r$]", "", 0 );
	menu_additem( menu, "\wMP5 Born Beast\r[5000\r$]", "", 0 );
	menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
	menu_display( id, menu, 0 );
	
	return PLUGIN_HANDLED;
}
public menu_handler(id, menu, item)
{
	money = cs_get_user_money(id)
	
	switch(item)
	{
		case 0:
		{
			if (money >= 8000)
			{
				cs_set_user_money(id, money - 8000)
				client_cmd(id, "svip_janus3")
				ChatColor(id,"!g[AMXX] !yYou have bought !g[janus3] \yEngoy Killing Zombie");
			}
	
			else
			{
				ChatColor(id,"!g[AMXX] !yYou dont hav enough money to buy !g[janus3]")
			}
		}
		case 1:
		{
			if (money >= 3000)
			{
				cs_set_user_money(id, money - 3000)
				client_cmd(id, "svip_tho7")
				ChatColor(id,"!g[AMXX] !yYou have bought !g[Thanatos-7] \yEngoy Killing Zombie");
			}
	
			else
			{
				ChatColor(id,"!g[AMXX] !yYou dont hav enough money to buy !g[Thanatos-7]")
			}
		}
		case 2:
		{
			if (money >= 5000)
			{
				cs_set_user_money(id, money - 5000)
				client_cmd(id, "svip_mp5")
				ChatColor(id,"!g[AMXX] !yYou have bought !g[MP5 Born Beast] \yEngoy Killing Zombie");
			}
	
			else
			{
				ChatColor(id,"!g[AMXX] !yYou dont hav enough money to buy !g[MP5 Born Beast]")
			}
		}
	}

	menu_destroy( menu );
	return PLUGIN_HANDLED;
}

// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4") // Green Color
	replace_all(msg, 190, "!y", "^1") // Default Color
	replace_all(msg, 190, "!t", "^3") // Team Color
	replace_all(msg, 190, "!t2", "^0") // Team2 Color
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players[i]))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	}
}


Create a new paste based on this one


Comments: