Cerere rezolvare erori

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
PigoExtreamCS
Membru, skill 0
Membru, skill 0
Posts: 52
Joined: 18 Dec 2013, 21:24
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 7 times
Been thanked: 1 time
Contact:

29 Dec 2013, 21:52

Salut imi puteti rezolva erorile dela acest plugin nu cred ca sunt grave.
| Afiseaza codul
/*
Cookie Force Jailbreak Plugin

Description:

This is a complete jailbreak plugin, including:

- Last request 8 games and 4 rebels
- Beacon on lr
- Weapon menu for CT
- Shop
- Days menu
- much more

Cvars:

- jb_points_kill 			How many points a T gets for killing a ct
- jb_shop_gunprice 			How many points a gun gamble costs
- jb_shop_pillsprice 		How many points Pills cost
- jb_shop_armorprice 		How many points armor costs
- jb_shop_camoprice 		How many points camo costs
- jb_show_players			SHows a hud with players left on top of screen
- jb_days 					Shows the days HUD
- jb_shop 					Opens the shop
- jb_points_headshot 		How many points T's get for killing a ct with a headshot
- jb_shop_nadepack_price	How many points the nade pack costs
- jb_showrebels 			Show rebels when they kill someone or not
- jb_blocktvoice Blocks 	Terrorist from voice chat
- jb_enable_days 			Enables the days menu
- jb_teleport				Enables/ disables the teleports on LR

Changelog:

1.0: Initial Release
1.1: Fixed lr bug
1.2: Added rebel system, fixed camo shop
1.3: Updated rebel system with glow and alarm
1.4: Added strip after LR win, optimalized lr
1.5: Fixed rebel weapon strip.
1.6: Fixed camo model.
1.7: Added t voice blocker by Exolent[jNr].
1.8: Fixed sounds(ac4570), index out of bounds error. 
1.9: Fixed sounds for the last time
2.0: Added several days, fixed gun toss
2.1: Fixed little typo in LR
2.2: Fixed Daysmenu items not showing up
2.3: Fixed crash on music day
2.4: Added new Lr: Choose specialday next round, teleport on some1s_jailbreak, fixed gun_blocker
2.5: Added cvar for teleport
2.6: Fixed rebeling won't stop
2.7: Fixed player out of range errors
2.8: Added Countdown, Nightcrawler day, Spartan Day, new sounds.
2.9: Fixed Deathmatch day, nightcrawler day, stopped sound on round end
3.0: Fixed Crash of shark day, added only one day/ round
3.1: Added ColorChat option.
3.2: Fixed index out of bounds error.


Credits:

Toast: For the base of the plugin
All the guys that helped me solve bugs
And everyone i forgot.


Notes:

I never though i would ever make this public, but since i stopped my jailbreak, due to few players, i'm releasing it.

The shops points are cookies, because the clan i made this for it called Cookie Force, so it was funny to make it cookies.

To disable ColorChat, comment define USE_CC on line 83

*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <nvault>

#define USE_CC

#if defined USE_CC
#include <colorchat>
#endif

///////////////
// =Defines= //
///////////////

#define VERSION "3.2"

#define IsPlayer(%1) (1<=%1<=g_max_clients)

#define REQUIRED_ADMIN_LEVEL ADMIN_KICK
#define ADMIN_VOICE ADMIN_MENU

#define OFFSET_PRIMARYWEAPON        116 

/////////////////////////////////////////////////////////


//////////////////
// =New things= //
//////////////////
#if defined USE_CC
	new const PREFIX[] = "[JailBreak]^x04:" // Prefix 
#else
	new const PREFIX[] = "[JailBreak]:" // Normal prefix
#endif

new g_max_clients		//client check

//	Cvars	
new cvar_killpoints		// How many Cookies a terrorist gets for 1 ct kill
new cvar_gunprice		// How many Cookies a gun costs
new cvar_pillsprice		// How many Cookies pills costs
new cvar_armorprice		// How many Cookies armor costs
new cvar_camoprice		// How many Cookies camo costs
new cvar_nadepackprice	// How many Cookies nades cost
new cvar_headshotpoints	// How many extra points a t gets for killing a ct
new cvar_days			// Is days hud should be displayed or not
new cvar_showplayers	// Shows the players in a nice hud message
new cvar_shop			// Open or close the shop
new cvar_showrebels		// Show rebels in chat
new cvar_tvoiceblock 	// Block T's from using voicechat
new cvar_daysmenu		// Enables the days menu
new cvar_teleport		// Enables/disables teleport on LR

//   Points system 	
new playerpoints[33]	// Amount of Cookies a player has
new g_vault				// Open a new vault to store a players points.

//	 Other Stuff
new days

new g_guards
new g_prisoners

new beacon_sprite

new lrgame[33]
enum 
{
	LR_NONE,
	LR_KNIFE,
	LR_S4S,
	LR_NADE,
	LR_SCOUT,
	LR_RACE,
	LR_SPRAY,
	LR_TOSS,
	LR_SHOTWAR,
	LR_SPECIAL,
	LR_REBEL
}

new specialday[21]
enum
{
	DAY_NONE,
	DAY_MUSIC,
	DAY_GRAV,
	DAY_FREEDAY,
	DAY_ZOMBIE,
	DAY_LAVA,
	DAY_SHARK,
	DAY_CAGE,
	DAY_DM,
	DAY_NIGHT,
	DAY_SPARTAN,
        DAY_FOOTBALL
}

// Sounds
new musicday_song[] 	= "sound/musicday1.mp3"
new musicday_song2[] 	= "sound/musicday2.mp3"
new musicday_song3[]	= "sound/musicday3.mp3"
new alarm[] 			= "sound/misc/alarm.mp3"
new race_go[] 			= "sound/jailbreak/race_go.mp3"
new s4ssound[] 			= "sound/jailbreak/s4s.mp3"
new spartansound[] 		= "sound/jailbreak/spartan_day.mp3"
new zombiesound[] 		= "sound/jailbreak/zombie_day.mp3"

new timer
new name[33]

////////////////////////////////////////////////////////////////

////////////////
// =Booleans= //
////////////////

new bool: lr_started			// Is last request?
new bool: got_camo[33]			// Does player got camo?
new bool: gravityday			// Is today a gravity day?	
new bool: spray_on				// Is spray contest on?
new bool: is_lr_s4s				// Is lr shot 4 shot?
new bool: shot_deagle[33]		// Did he shoot his deagle?
new bool: is_rebel[33]			// Is the player a rebel?
new bool: can_have_gun[33]  	// Can he have a gun?
new bool: lr_next_special[33]	// Specialday next round
new bool: got_name = false		// Got the players name on cd?
new bool: countdown_on = false	// Is counting down?

new bool:g_connected[33]



///////////////////////////////////////////////////////////////

//////////////
// =Stocks= //
//////////////

stock check_user(index)
{
	if(!is_user_connected(index) ||(is_user_bot(index)))
	{
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

stock strip_weapons(index)
{

    strip_user_weapons(index)
    set_pdata_int(index, OFFSET_PRIMARYWEAPON, 0)
    give_item(index, "weapon_knife")
} 

//////////////////////////////////////////////////////////////
//---------------PLUGIN INIT--------------------------------//
//////////////////////////////////////////////////////////////

public plugin_init()
{
	register_plugin("CF Jailbreak", VERSION, "Drekes")
	
	//cvars
	cvar_killpoints = register_cvar("jb_points_kill", "2")
	cvar_gunprice = register_cvar("jb_shop_gunprice", "8")
	cvar_pillsprice = register_cvar("jb_shop_pillsprice", "7")
	cvar_armorprice = register_cvar("jb_shop_armorprice", "4")
	cvar_camoprice = register_cvar("jb_shop_camoprice", "10")
	cvar_showplayers = register_cvar("jb_show_players", "1")
	cvar_days = register_cvar("jb_days", "1")
	cvar_shop = register_cvar("jb_shop", "1")
	cvar_headshotpoints = register_cvar("jb_points_headshot", "2")
	cvar_nadepackprice = register_cvar("jb_shop_nadepack_price", "5")
	cvar_showrebels = register_cvar("jb_show_rebels", "1")
	cvar_tvoiceblock = register_cvar("jb_blocktvoice", "1")
	cvar_daysmenu = register_cvar("jb_enable_days", "1")
	cvar_teleport = register_cvar("jb_teleport", "0")
	
	register_cvar("cfjail_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)

	RegisterHam(Ham_Spawn, "player", "Event_Playerspawn", 1)
	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_deagle", "fw_primary_attack")
	RegisterHam(Ham_TakeDamage, "player", "Event_TakeDamage")
	
	register_forward(FM_Voice_SetClientListening, "FwdSetVoice");

	//Events
	register_event("DeathMsg", "Event_Deathmsg", "a")
	register_logevent("Event_Roundend", 2, "1=Round_End") 
	register_logevent("Event_Roundstart", 2, "1=Round_Start")
	register_event("CurWeapon", "Event_CurWeapon", "be","1=1")

	
	//client commands
	register_clcmd("say /lr", "lr_check")
	register_clcmd("say !lr", "lr_check")
	register_clcmd("say /rules", "showrules")
	register_clcmd("say_team /rules", "showrules")
	register_clcmd("say /shop", "cmd_shop")
	register_clcmd("say_team /shop", "cmd_shop")
	register_clcmd("say /daysmenu", "specialday_check")
	register_concmd("say /countdown", "cdmenu")
	
	//Console (admin) Commands
	register_concmd("amx_take_points", "cmd_take_points", ADMIN_KICK, "<target> <amount>")
	register_concmd("amx_give_points", "cmd_give_points", ADMIN_KICK, "<target> <amount>")

	//Other Things
	g_max_clients = get_maxplayers()
	
	g_vault = nvault_open("jbpoints")	// Open a vault for the points
	
	set_task(1.0, "players_hud", 0, _, _, "b")
}

///////////////////////////////////////////////////
//--------------PRECACHE-------------------------//
///////////////////////////////////////////////////
public plugin_precache()
{
	precache_generic(musicday_song)
	precache_generic(musicday_song2)
	precache_generic(musicday_song3)
	precache_generic(alarm)
	precache_generic(race_go)
	precache_generic(s4ssound)
	precache_generic(spartansound)
	precache_generic(zombiesound)
	
	precache_sound("fvox/one.wav")
	precache_sound("fvox/two.wav")
	precache_sound("fvox/three.wav")
	precache_sound("fvox/four.wav")
	precache_sound("fvox/five.wav")
	precache_sound("fvox/six.wav")
	precache_sound("fvox/seven.wav")
	precache_sound("fvox/eight.wav")
	precache_sound("fvox/nine.wav")
	precache_sound("fvox/ten.wav")
	precache_sound("fvox/eleven.wav")
	precache_sound("fvox/twelve.wav")
	precache_sound("fvox/thirteen.wav")
	precache_sound("fvox/fourteen.wav")
	precache_sound("fvox/fifteen.wav")
	precache_sound("radio/com_go.wav")
	
	precache_model("models/player/gign/gign.mdl")
	
	beacon_sprite = precache_model("sprites/shockwave.spr")
}
///////////////////////////////////////////////////
//-------------PLAYER SPAWN----------------------//
///////////////////////////////////////////////////
public Event_Playerspawn(id)
{
	if(!IsPlayer(id))
		return PLUGIN_HANDLED
		
	if(is_user_alive(id))
	{
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			strip_weapons(id)
			gun_check(id)
		}
		
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			if(got_camo[id])
			{
				cs_reset_user_model(id)
				got_camo[id] = false
			}
			
			if(lr_next_special[id])
			{
				specialday_menu(id)
				lr_next_special[id] = false
			}

			if(is_rebel[id])
				unrebel(id)
				
			strip_weapons(id)
			lr_started = false
			is_rebel[id] = false
			lrgame[id] = LR_NONE
		}
		can_have_gun[id] = true
		set_user_rendering(id)
	}
	specialday[20] = DAY_NONE
	return PLUGIN_HANDLED
}

//////////////////////////////////////////////////////////////////
//--------------------PLAYER DEATH------------------------------//
//////////////////////////////////////////////////////////////////
public Event_Deathmsg()
{
	new attacker = read_data(1)
	new victim = read_data(2)
	new headshot = read_data(3)
	
	new AttackerName[32]
	new VictimName[32]
	
	get_user_name(attacker, AttackerName, 31)
	get_user_name(victim, VictimName,31)
	
	if(!IsPlayer(attacker))
		return PLUGIN_HANDLED
		
	if(!IsPlayer(victim))
		return PLUGIN_HANDLED

	if( cs_get_user_team(attacker) == CS_TEAM_CT && cs_get_user_team(victim) == CS_TEAM_T)
	{
		if(get_pcvar_num(cvar_showrebels) && !lr_started)
		{
			if(!is_rebel[victim])
			{
				#if defined USE_CC
					ColorChat(0, RED, "%s Gradianul^x03 %s^x04 L-a omorat pe^x03 %s!", PREFIX, AttackerName, VictimName)
				#else
					client_print(0, print_chat, "%s Guard %s killed prisoner %s!", PREFIX, AttackerName, VictimName)
				#endif
			}
		
			else
			{
				#if defined USE_CC
					ColorChat(0, RED, "%s Gardianul^x03 %s^x04 L-a omorat pe rebelul^x03 %s!", PREFIX, AttackerName, VictimName)
				#else
					client_print(0, print_chat, "%s Guard %s killed rebel %s", PREFIX, AttackerName, VictimName)
				#endif
				unrebel(victim)
			}
		}
	}
	
	if( cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
	{
		playerpoints[attacker] += get_pcvar_num(cvar_killpoints)
		
		if(headshot)
			playerpoints[attacker] += get_pcvar_num(cvar_headshotpoints);
			
		if(lr_started)
		{
			if(is_lr_s4s)
				is_lr_s4s = false
			
			if(lrgame[attacker] != LR_REBEL)
				strip_weapons(attacker)
				
			lr_started = false
			lrgame[attacker] = LR_NONE
		}
	}
	
	if(spray_on)
	{
		server_cmd("decalfrequency 20")
		spray_on = false
	}
	
	if(task_exists(attacker))
		remove_task(attacker)
		
	if(task_exists(victim))
		remove_task(victim)
	
	SaveData(attacker)
	
	return PLUGIN_HANDLED
}  
	
////////////////////////////////////////////////////////////
//-----------------ROUND END/ ROUND START-----------------//
////////////////////////////////////////////////////////////
public Event_Roundend()
{
	if(gravityday)
	{
		server_cmd("sv_gravity 800")
		gravityday = false
	}

	if(specialday[20] == DAY_DM)
		server_cmd("mp_friendlyfire 0")
		
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
}	
public Event_Roundstart()
{
	if(get_pcvar_num(cvar_days))
	{
		days ++
	}
	if(get_pcvar_num(cvar_showplayers))
	{
		g_guards = 0
		g_prisoners = 0
	}
}

/////////////////////////////////////////////////////
//-----------------TAKE DAMAGE---------------------//
/////////////////////////////////////////////////////
public Event_TakeDamage(victim, weapon, attacker, float: damage, damagebits)
{
	if(IsPlayer(victim) && IsPlayer(attacker))
	{
		if(get_pcvar_num(cvar_showrebels) && !is_rebel[attacker] && !lr_started && IsPlayer(attacker) && IsPlayer(victim))
		{
			if(victim != attacker && attacker != 0)
			{
				if(cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
				{
					make_rebel(attacker, victim)
				}
			}
		}
	}
}
	
/////////////////////////////////////////////////////
//-----------------PLAYER DISCONNECTS--------------//
/////////////////////////////////////////////////////
public client_disconnect(id)
{
	SaveData(id) 
	g_connected[id] = false;
}

//////////////////////////////////////////////////////
//----------------CLIENT PUTINSERVER----------------//
//////////////////////////////////////////////////////
public client_putinserver(id)  
	g_connected[id] = true;
//////////////////////////////////////////////////////
//-----------------SOMETHING ELSE-------------------//
//////////////////////////////////////////////////////
public Player_Jump(id)
{
	if( is_user_alive(id) && entity_get_float(id, EV_FL_fuser2) > 0.0 )
	{
		entity_set_float(id, EV_FL_fuser2, 0.0)
	}
}


//////////////////////////////////////////////////////
//-----------ON MAP CHANGE OR SERVER CRASH----------//
//////////////////////////////////////////////////////
public plugin_end()
{
	nvault_close(g_vault)
}

//////////////////////////////////////////////////////
//---------------CT GUN MENU------------------------//
//////////////////////////////////////////////////////
public gun_check(id)
{
	if(IsPlayer(id) && cs_get_user_team(id) == CS_TEAM_CT)
	{
		primgun_menu(id)
	}
	return PLUGIN_HANDLED
}

//////////////////////////////////////////////////////
//----------------MAKE REBEL------------------------//
//////////////////////////////////////////////////////
public make_rebel(attacker, victim)
{
	new attackername[33], victimname[33]
	get_user_name(attacker, attackername, 32)
	get_user_name(victim, victimname, 32)
	
	#if defined USE_CC
		ColorChat(0, RED, "%s^x03 %s^x04 L-a atacat pe^x03 %s^x04 Si acum este un rebel", PREFIX, attackername, victimname)
	#else
		client_print(0, print_chat, "%s %s attacked %s and is now a rebel!", PREFIX, attackername, victimname)
	#endif
	
	set_user_rendering(attacker, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16)
	client_cmd(0, "mp3 play ^"%s^"", alarm)
	is_rebel[attacker] = true
}

/////////////////////////////////////////////////////
//--------------UNDO REBEL-------------------------//
/////////////////////////////////////////////////////
public unrebel(id)
{
	if(is_user_connected(id))
	{
		set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 255)
		is_rebel[id] = false
	}
}
/*========================PRIMARY WEAPON======================*/

public primgun_menu(id)
{	
	if(!IsPlayer(id))
		return PLUGIN_HANDLED
		
	new primgunmenu = menu_create("\yAlege-ti Echipamentul:", "sub_primgun_menu")

	menu_additem(primgunmenu, "\rFortele Americane(M4A1+Deagle)", "1", 0);
	menu_additem(primgunmenu, "\rFortele Arabe(AK47+Deagle)", "2", 0);
	menu_additem(primgunmenu, "\rFortele Germane(AWP+Deagle)", "3", 0);
	menu_additem(primgunmenu, "\rFortele Romane(MP5+Deagle)", "4", 0);
	menu_additem(primgunmenu, "\rFortele Britanice(XM1014+Degale)", "5", 0);
        menu_additem(primgunmenu, "\rFortele Italiene(SG550+Degale)", "6", 0);
		
	menu_setprop(primgunmenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, primgunmenu, 0);
	return PLUGIN_HANDLED
}	

public sub_primgun_menu(id, primgunmenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(primgunmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(primgunmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			primgun1(id)
		}
		case 2: 
		{
			primgun2(id)
		}
		case 3:
		{
			primgun3(id)
		}
		case 4:
		{
			primgun4(id)
		}
		case 5:
		{
			primgun5(id)
		}
                case 6:
		{
			primgun6(id)
		}
	}
	
	menu_destroy(primgunmenu);
	return PLUGIN_HANDLED;
}

public primgun1(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_deagle" )
	give_item( id, "weapon_m4a1" )
	cs_set_user_bpammo( id, CSW_M4A1, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}

public primgun2(id)
{
        give_item( id, "weapon_knife" )
	give_item(id, "weapon_ak47")
	give_item(id, "weapon_usp")
	cs_set_user_bpammo(id, CSW_USP, 100)
	cs_set_user_bpammo(id, CSW_AK47, 200)
}

public primgun3(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_deagle" )
	give_item( id, "weapon_awp" )
	cs_set_user_bpammo( id, CSW_AWP, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}

public primgun4(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_mp5navy" )
	give_item( id, "weapon_deagle" )
	cs_set_user_bpammo( id, CSW_MP5NAVY, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}	

public primgun5(id)
{
	 give_item( id, "weapon_knife" )
	 give_item( id, "weapon_xm1014" )
	 give_item( id, "weapon_deagle" )
	 cs_set_user_bpammo( id, CSW_XM1014, 200 )
	 cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}
public primgun6(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_sg550" )
	give_item( id, "weapon_deagle" )
	cs_set_user_bpammo( id, CSW_SG550, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}
///////////////////////////////////////////////////////////////
//--------------------RULES MOTD-----------------------------//
///////////////////////////////////////////////////////////////
public showrules(id)
{
	show_motd(id, "jailrules.txt", "Jailbreak Rules")
}

//////////////////////////////////////////////////////////////////
//----------------POINTS SAVE AND LOAD--------------------------//
//////////////////////////////////////////////////////////////////
public SaveData(id) 
{  
	new authid[32];
	get_user_authid(id,authid,31);

	new vaultkey[64], vaultdata[64];

	//Save their points     
	format(vaultkey,63,"jb-%s-points",authid);     
	format(vaultdata,63,"%d",playerpoints[id]);     
	set_vaultdata(vaultkey,vaultdata);  
}

public LoadData(id) 
{
	new authid[32]; 
	get_user_authid(id,authid,31); 

	new vaultkey[64], vaultdata[64]; 
	//Load their points
	format(vaultkey,63,"jb-%s-points",authid); 
	get_vaultdata(vaultkey,vaultdata,63); 
	playerpoints[id] = str_to_num(vaultdata); 
}

//////////////////////////////////////////////////////////////
//----------------THE SHOP----------------------------------//
//////////////////////////////////////////////////////////////
public cmd_shop(id)
{
	if(!get_pcvar_num(cvar_shop))
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s We are currently working on the shop, it will be opened soon.", PREFIX)
		#else
			client_print(id, print_chat, "%s We are currently working on the shop, it will be opened soon.", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	if(cs_get_user_team(id) != CS_TEAM_T)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s Only^x03 prisoners^x04 can use the shop", PREFIX)
		#else
			client_print(id, print_chat, "%s Only prisoners can use the shop!", PREFIX)
		#endif
		
		return PLUGIN_HANDLED;
	}
	
	if(lr_started)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s You can use the shop while last request is activated", PREFIX)
		#else
			client_print(id, print_chat, "%s You can't use the shop while last request is activated!", PREFIX)
		#endif
		
		return PLUGIN_CONTINUE
	}
	
	if(is_rebel[id])
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s Detinutii rebeli nu pot folosii shopul.", PREFIX)
		#else
			client_print(id, print_chat, "%s Rebels can't use the shop!", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(!is_user_alive(id))
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s Trebuie sa fi in^x03 viata^x04 pentru a folosii shopul.", PREFIX)
		#else
			client_print(id, print_chat, "%s You must be alive to use the shop!", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	else if(cs_get_user_team(id) == CS_TEAM_T)
	{
		shopmenu(id)
	}
	return PLUGIN_HANDLED
}

public shopmenu(id)
{
	if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
	{
		new szText[555 char]
		new points = playerpoints[id]
	
		formatex(szText, charsmax(szText), "Shop pe Prajituri^nPrajiturile tale: %d", points)
		new shopmenu = menu_create(szText, "sub_shopmenu")
		
		formatex(szText, charsmax(szText), "Deagle/Mori: %d Cookies", get_pcvar_num(cvar_gunprice))
		menu_additem(shopmenu, szText, "1", 0)
		
		formatex(szText, charsmax(szText), "Marihuana: %d Cookies", get_pcvar_num(cvar_pillsprice))
		menu_additem(shopmenu, szText, "2" , 0)
		
		formatex(szText, charsmax(szText), "Armor: %d Cookies", get_pcvar_num(cvar_armorprice))
		menu_additem(shopmenu, szText, "3", 0)

		formatex(szText, charsmax(szText), "Skin Gardian: %d Cookies", get_pcvar_num(cvar_camoprice))
		menu_additem(shopmenu, szText, "4", 0)
		
		formatex(szText, charsmax(szText), "Pachet Grenazi: %d Cookies", get_pcvar_num(cvar_nadepackprice))
		menu_additem(shopmenu, szText, "5", 0)
		
		menu_setprop(shopmenu, MPROP_EXIT , MEXIT_ALL);
		menu_display(id, shopmenu, 0);
	}
	return PLUGIN_HANDLED
}

public sub_shopmenu(id, shopmenu, item)  
{
	if (item == MENU_EXIT)
	{
		menu_destroy(shopmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_gunprice))
			{
				#if defined USE_CC
					ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
					client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif
			
				return PLUGIN_HANDLED
			}
			
			else
			{
				gun_gamble(id)
			}
		}
		
		case 2: 
		{
			if(playerpoints[id] < get_pcvar_num(cvar_pillsprice))
			{
				#if defined USE_CC
					ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
					client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif
				
				return PLUGIN_HANDLED
			}
			
			else
			{
				give_pills(id)
			}
		}
		
		case 3:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_armorprice))
			{
				#if defined USE_CC
					ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
					client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif			

				return PLUGIN_HANDLED
			}
			
			else
			{
				give_armor(id)
			}
		}
		
		case 4:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_camoprice))
			{
				#if defined USE_CC
					ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
					client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif			

				return PLUGIN_HANDLED
			}
			
			else
			{
				give_camo(id)
			}
		}
		
		case 5:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_nadepackprice))
			{
				#if defined USE_CC
					ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
					client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif			

				return PLUGIN_HANDLED
			}
			
			else
			{
				give_nadepack(id)
			}
		}
	}
	menu_destroy(shopmenu);
	return PLUGIN_HANDLED;
}
		
public gun_gamble(id)
{
	if(random_num(1, 3) == 1)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s Ai avut nororc^x03 si ai primit pistolul!", PREFIX)
		#else
			client_print(id, print_chat, "%s You gambled for a pistol and you got it!", PREFIX)
		#endif
		
		give_item(id, "weapon_deagle");
	}
	
	else
	{
		user_kill(id)
		
		#if defined USE_CC
			ColorChat(id, RED, "%s Nu ai avut noroc si ai^x03 murit", PREFIX)
		#else
			client_print(id, print_chat, "%s You gambled for a pistol and died.", PREFIX)
		#endif
	}	
	
	playerpoints[id] -= get_pcvar_num(cvar_gunprice)
	
	return PLUGIN_HANDLED
}
		
public give_pills(id)
{
	new health = get_user_health(id) + 50

	set_user_health(id, health)
	
	#if defined USE_CC
		ColorChat(id, RED, "%s Ai cumparat^x03 Marihuana.", PREFIX)
	#else
		client_print(id, print_chat, "%s You bought pills.", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_pillsprice)
	
	return PLUGIN_HANDLED
}
		
public give_armor(id)
{
	new armor = get_user_armor(id) + 50
	
	set_user_armor(id, armor)
	
	#if defined USE_CC
		ColorChat(id, RED, "%s Ai cumparat^x03 Armura.", PREFIX)
	#else
		client_print(id, print_chat, "%s You bought armor.", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_armorprice) 

	return PLUGIN_HANDLED
}

public give_camo(id)
{
	set_user_info(id, "model", "jbemodel");
        entity_set_int(id, EV_INT_body, 3);
	got_camo[id] = true
	
	#if defined USE_CC
		ColorChat(id, RED, "%s Ai cumparat^x03 Skin Gardian.", PREFIX)
	#else
		client_print(id, print_chat, "%s You bought camo.", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_camoprice)

	return PLUGIN_HANDLED
}

public give_nadepack(id)
{
	give_item(id, "weapon_flashbang")
	give_item(id, "weapon_hegrenade")
	give_item(id, "weapon_smokegrenade")	
	
	#if defined USE_CC
		ColorChat(id, RED, "%s Ai cumparat^x03 Pachet de Grenazi", PREFIX)
	#else
		client_print(id, print_chat, "%s you bought a nade pack", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_nadepackprice)

	return PLUGIN_HANDLED
}

////////////////////////////////////////////////////////////////////
//--------------------GIVE/TAKE POINTS----------------------------//
////////////////////////////////////////////////////////////////////
public cmd_give_points(id,level,cid)
{
	if(!cmd_access(id,level,cid,3))
		return PLUGIN_HANDLED;
 
	new target[32], amount[21], reason[21];
 
	read_argv(1, target, 31 );
	read_argv(2, amount, 20 );
	read_argv( 3, reason, 20 );
 
	new player = cmd_target( id, target, 8 );
 
	if( ! player ) 
		return PLUGIN_HANDLED;
 
	new admin_name[32], player_name[32];
	get_user_name(id, admin_name, 31);
	get_user_name(player, player_name, 31);
 
	new pointnum = str_to_num(amount);
 
	playerpoints[player] += pointnum;
 
	switch(get_cvar_num ("amx_show_activity"))
	{
		case 1: client_print( 0, print_chat, "%s ADMIN: gave %i points for %s.",PREFIX, pointnum, player_name );
		case 2: client_print( 0, print_chat, "%s ADMIN %s: gave %i points for %s.",PREFIX, admin_name, pointnum, player_name );
	}
	
	client_print(player, print_chat, "%s You received %i points.(Total: %d)",PREFIX, pointnum, playerpoints[player]);
 
	SaveData( id )
 
	return PLUGIN_CONTINUE;
}
 
public cmd_take_points(id,level,cid)
{
	if(!cmd_access (id, level, cid, 3))
		return PLUGIN_HANDLED;
 
	new target[32], amount[21], reason[21];
 
	read_argv( 1, target, 31 );
	read_argv( 2, amount, 20 );
	read_argv( 3, reason, 20 );
 
	new player = cmd_target( id, target, 8 );
 
	if(!player ) 
		return PLUGIN_HANDLED;
 
	new admin_name[32], player_name[32];
	get_user_name( id, admin_name, 31 );
	get_user_name( player, player_name, 31 );
 
	new pointnum = str_to_num( amount );
 
	playerpoints[player] -= pointnum;
	
	switch(get_cvar_num("amx_show_activity"))
	{
		case 1: client_print( 0, print_chat, "%s ADMIN: took %i points from %s.",PREFIX,  pointnum, player_name );
		case 2: client_print( 0, print_chat, "%s ADMIN %s: took %i points from %s.",PREFIX, admin_name, pointnum, player_name );
	}
	
	client_print( player, print_chat, "You lost %i points. (Total: %d)", pointnum, playerpoints[player] );
 
	SaveData( id )
 
	return PLUGIN_CONTINUE;
}

/////////////////////////////////////////////////////////////
//--------------------COUNTDOWN STUFF----------------------//
/////////////////////////////////////////////////////////////
public cdmenu(id)
{
	if(get_user_team(id) != 2)
	{
		#if defined USE_CC
			ColorChat(id, RED, "Only^x03 Counter-terrorists^x04 can start a^x03 countdown", PREFIX)
		#else
			client_print(id, print_chat, "%s Only Counter-terrorist can start a countdown", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(countdown_on)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s There is already a^x03 countdown^x04 on", PREFIX)
		#else
			client_print(id, print_chat, "%s There is already a countdown on", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	new menu = menu_create("\yCountDown Menu", "menu_handler")
	
	menu_additem(menu, "\w5 Seconds", "1", 0)
	menu_additem(menu, "\w10 Seconds", "2", 0)
	menu_additem(menu, "\w15 Seconds", "3", 0)
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, menu, 0)
	
	return PLUGIN_HANDLED
}

public menu_handler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new Data[7], Name[64]
	new Access, Callback
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, Callback)
	
	new Key = str_to_num(Data)
	
	switch(Key)
	{
		case 1:
		{
			timer = 5
		}
		
		case 2:
		{
			timer = 10
		}
			
		case 3:
		{
			timer = 15
		}
	}
	countdown_on = true
	got_name = false
	countdown(id)
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

public countdown(id)
{
	if(!got_name)
		get_user_name(id, name, 32)
		
	switch(timer)
	{
		case 0:
		{
			set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 3.0)
			show_hudmessage(0, "Go go go")
			client_cmd(0, "spk ^"sound/radio/com_go.wav^"")
			countdown_on = false
		}
		
		case 1:
		{
			client_cmd(0, "spk ^"fvox/one.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 2:
		{
			client_cmd(0, "spk ^"fvox/two.wav^"")
			set_task(1.0, "countdown", 0)
		}
			
		case 3:
		{
			client_cmd(0, "spk ^"fvox/three.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 4:
		{
			client_cmd(0, "spk ^"fvox/four.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 5:
		{
			client_cmd(0, "spk ^"fvox/five.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 6:
		{
			client_cmd(0, "spk ^"fvox/six.wav^"")
			set_task(1.0, "countdown", 0)
		}
		case 7:
		{
			client_cmd(0, "spk ^"fvox/seven.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 8:
		{
			client_cmd(0, "spk ^"fvox/eight.wav^"")
			set_task(1.0, "countdown", 0)
		}
			
		case 9:
		{
			client_cmd(0, "spk ^"fvox/nine.wav^"")
			set_task(1.0, "countdown", 0)
		}
			
		case 10:
		{
			client_cmd(0, "spk ^"fvox/ten.wav^"")		
			set_task(1.0, "countdown", 0)
		}
		
		case 11:
		{
			client_cmd(0, "spk ^"fvox/eleven.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 12:
		{
			client_cmd(0, "spk ^"fvox/twelve.wav^"")
			set_task(1.0, "countdown", 0)
		}
			
		case 13:
		{
			client_cmd(0, "spk ^"fvox/thirteen.wav^"")
			set_task(1.0, "countdown", 0)
		}
			
		case 14:
		{
			client_cmd(0, "spk ^"fvox/fourteen.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 15:
		{
			client_cmd(0, "spk ^"fvox/fifteen.wav^"")
			set_task(1.0, "countdown", 0)
		}
	}
	
	if(timer != 0)
	{
		set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 3.0)
		show_hudmessage(0, "%s started countdown: %i", name, timer)
		timer--
	}
	got_name = true
}

/////////////////////////////////////////////////////////////
//-----------------THE DAYS MENU---------------------------//
/////////////////////////////////////////////////////////////
public specialday_check(id)
{
	if(!get_pcvar_num(cvar_daysmenu))
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s Days are^x03 disabled", PREFIX)
		#else
			client_print(id, print_chat, "%s Days are disabled", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(get_user_team(id) != 2)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s Numai^x03 Gardienii^x04 pot porni^x03 o zi speciala", PREFIX)
		#else
			client_print(id, print_chat, "%s Only CT's can start a special day", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(!is_user_alive(id))
	{	
		#if defined USE_CC
			ColorChat(id, RED, "%s Trebuie sa fi^x03 in viata^x04 pentru a da^x03 o zi speciala", PREFIX)
		#else
			client_print(id, print_chat, "%s You have to be alive to start a special day", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(specialday[20] != DAY_NONE)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s There is already a day chosen", PREFIX)
		#else
			client_print(id, print_chat, "%s There is already a day chosen", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	specialday_menu(id)
	return PLUGIN_HANDLED
}

public specialday_menu(id)
{
	new specialdaymenu = menu_create("\ySpecial Days:", "specialday_submenu")
	
	menu_additem(specialdaymenu, "\wMusic Day", "1", 0);
	menu_additem(specialdaymenu, "\wGravity Day", "2", 0);
	menu_additem(specialdaymenu, "\wMoartea Cocosului", "3", 0);
	menu_additem(specialdaymenu, "\wZombie Day", "4", 0);
	menu_additem(specialdaymenu, "\wLava Day", "5", 0);
	menu_additem(specialdaymenu, "\wShark Day", "6", 0);
	menu_additem(specialdaymenu, "\wCage Day", "7", 0);
	menu_additem(specialdaymenu, "\wDeathMatch Day", "8", 0);
	menu_additem(specialdaymenu, "\wNight Crawler Day", "9", 0)
	menu_additem(specialdaymenu, "\wSpartan Day", "10", 0)
		
	menu_setprop(specialdaymenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, specialdaymenu, 0);
}

public specialday_submenu(id, specialdaymenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(specialdaymenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(specialdaymenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
			specialday[20] = DAY_MUSIC
		
		case 2:
			specialday[20] = DAY_GRAV
		
		case 3:
			specialday[20] = DAY_FREEDAY
		
		case 4:
			specialday[20] = DAY_ZOMBIE
		
		case 5:
			specialday[20] = DAY_LAVA
		
		case 6:
			specialday[20] = DAY_SHARK
		
		case 7:
			specialday[20] = DAY_CAGE
		
		case 8:
			specialday[20] = DAY_DM
		
		case 9:
			specialday[20] = DAY_NIGHT
		
		case 10:
			specialday[20] = DAY_SPARTAN

                case 11:
			specialday[20] = DAY_FOOTBALL
			
	}	
	
	if(IsPlayer(id) && is_user_alive(id))
		do_specialday(id)
		
	menu_destroy(specialdaymenu);
	return PLUGIN_HANDLED
}

public do_specialday(id)
{
	for(new i = 0; i < g_max_clients; i++)
	{
		switch(specialday[20])
		{
			case DAY_MUSIC:
			{
				new musicmenu = menu_create("\yMusic Choice", "musicday_submenu")
	
				menu_additem(musicmenu, "\wPorneste Muzica", "1", 0)
				menu_additem(musicmenu, "\wOpreste Muzica", "2", 0)
	
				menu_setprop(musicmenu,MPROP_EXIT, MEXIT_ALL)
				menu_display(id, musicmenu, 0)
			}
			
			case DAY_GRAV:
			{
				server_cmd("sv_gravity 200")
			
				#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este^x03 Gravity day", PREFIX)
				#else
					client_print(0, print_chat, "%s Today is Gravity day", PREFIX)
				#endif
				
				gravityday = true
			}
			
			case DAY_FREEDAY:
			{
				case CS_TEAM_T:
						{
							
							give_item(i, "weapon_ak47")
							give_item(i, "weapon_m4a1")
                                                        give_item(i, "weapon_awp")
 
							
							cs_set_user_bpammo(i, CSW_AK47, 200)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
                                                        cs_set_user_bpammo(i, CSW_AWP, 200)
						}
                                case CS_TEAM_CT:
						{	
							give_item(i, "weapon_ak47")
							give_item(i, "weapon_m4a1")
                                                        give_item(i, "weapon_awp")
							
							cs_set_user_bpammo(i, CSW_AK47, 200)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
                                                        cs_set_user_bpammo(i, CSW_AWP, 200)	
						}
				
				#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este^x03 GunDay", PREFIX)
				#else
					client_print(0, print_chat, "%s Today is Freeday", PREFIX)
				#endif
			}
			
			case DAY_ZOMBIE:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{	
					switch(cs_get_user_team(i))
					{
						case CS_TEAM_T:
						{
							set_user_health(i, 150)
							
							give_item(i, "weapon_ak47")
							give_item(i, "weapon_m4a1")
							
							cs_set_user_bpammo(i, CSW_AK47, 200)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
						}
						
						case CS_TEAM_CT:
						{
							if(is_user_alive(i))
							{
								set_user_health(i, 1500)
								can_have_gun = false
							}
						}
					}
				}
				
				client_cmd(0, "mp3 play ^"%s^"", zombiesound)
				
				#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este^x03 Zombie Day", PREFIX)
				#else
					client_print(0, print_chat, "%s Astazi este Zombie day", PREFIX)
				#endif				
			}
			
			case DAY_LAVA:
			{
				#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este^x03 Lava Day,^x03 Stati pe^x03 tatuaje tot timpul ", PREFIX)
				#else
					client_print(0, print_chat, "%s Today is Lava day, Stand on a spray at all times", PREFIX)
				#endif
			}
			
			case DAY_SHARK:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{
					switch(cs_get_user_team(i))
					{
						case CS_TEAM_T:
						{
							
							give_item(i, "weapon_ak47")
							give_item(i, "weapon_m4a1")
							
							cs_set_user_bpammo(i, CSW_AK47, 200)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
						}
						
						case CS_TEAM_CT:
						{
							if(is_user_alive(i))
							{
								set_user_noclip(i, 1)
								set_user_health(i, 300)
							}
						}
					}
					
					#if defined USE_CC
						ColorChat(0, RED, "%s Astazi este^x03 Shark Day", PREFIX)
					#else	
						client_print(0, print_chat, "%s Astazi e SharkDay", PREFIX)
					#endif
				}
			}
				
			case DAY_CAGE:
			{
				#if defined USE_CC
					ColorChat(0, RED, "%s Today is cage day", PREFIX)
				#else
					client_print(0, print_chat, "%s Astazi este CageDay", PREFIX)
				#endif
			}
			
			case DAY_DM:
			{
				server_cmd("mp_friendlyfire 1")
				
				#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este^x03 Deathmatch Day,^x04 Ultimul prizonier sa dea /lr", PREFIX)
				#else
					client_print(0, print_chat, "%s Astazi este Deathmatch Day, Ultimul prizonier sa dea LR", PREFIX)
				#endif
			}
			
			case DAY_NIGHT:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{	
					switch(cs_get_user_team(i))
					{
						case CS_TEAM_T:	
						{
							give_item(i, "weapon_m4a1")
							give_item(i, "weapon_deagle")
							
							cs_set_user_bpammo(i, CSW_M4A1, 200)
							cs_set_user_bpammo(i, CSW_DEAGLE, 100)
						}
						
						case CS_TEAM_CT:
						{
							strip_weapons(i)
							
							set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
							can_have_gun = false
						}
					}
				}
				
				#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este a^x03 NightCrawler Day", PREFIX)
				#else
					client_print(0, print_chat, "%s Astazi este NightCrawler Day", PREFIX)
				#endif
			}
			
			case DAY_SPARTAN:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{
					switch(cs_get_user_team(i))
					{
						case CS_TEAM_T:
						{
							give_item(i, "weapon_shield")
							give_item(i, "weapon_deagle")
							
							cs_set_user_bpammo(i, CSW_DEAGLE, 100)
						}
						
						case CS_TEAM_CT:
						{
							give_item(i, "weapon_deagle")
							give_item(i, "weapon_m4a1")
							
							cs_set_user_bpammo(i, CSW_DEAGLE, 100)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
						}
					}
				}
				
				#if defined USE_CC
					ColorChat(0, RED, "%s Today is^x03 Spartan Day", PREFIX)
				#else
					client_print(0, print_chat, "%s Astazi este Spartan Day", PREFIX)
				#endif
			}
                        case DAY_FOOTBALL:
                        {
                        if(IsPlayer(i) && is_user_alive(i))
				{
					switch(cs_get_user_team(i))
					{
						case CS_TEAM_T:
						{
							set_user_health(id, 50);

						}
						
						case CS_TEAM_CT:
						{
                                                        set_user_health(id, 5000000);
		
						}    

}

public musicday_submenu(id, musicmenu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(musicmenu)
		return PLUGIN_HANDLED
	}
	
	new Data[7], Name[64]
	new Access, Callback
	menu_item_getinfo(musicmenu, item, Access, Data, 5, Name, 63, Callback)
	
	new key = str_to_num(Data)
	
	switch(key)
	{
		case 1:
		{
			switch(random_num(1, 3))
			{
				case 1:
				{
					client_cmd(0, "mp3 play ^"%s^"", musicday_song)
				}
				
				case 2:
				{
					client_cmd(0, "mp3 play ^"%s^"", musicday_song2)
				}
				case 3:
				{
					client_cmd(0, "mp3 play ^"%s^"", musicday_song3)
				}
			}
		}
		
		case 2:
		{
			client_cmd(0, "mp3 stop")
		}
	}
	menu_display(id, musicmenu, 0)
	return PLUGIN_CONTINUE
}
////////////////////////////////////////////////////////
//-------------SHOW THE REMAINING PLAYERS-------------//
////////////////////////////////////////////////////////
public players_hud()
{
	if(get_pcvar_num(cvar_showplayers))
	{	
		g_prisoners = 0;
		g_guards = 0;
			
		for(new i = 0; i < g_max_clients; i++)
		{
			new id = i;
        
			if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
			{
				g_guards++;
			}
			else if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
			{	
				g_prisoners++;
			}	
		}
		set_hudmessage(0, 255, 0, -1.0, 0.01)
		show_hudmessage(0,"Prizonieri: %i^nGardieni: %i", g_prisoners, g_guards)
	}
}
/*=====================================================================
			LAST REQUEST MAIN MENU
=====================================================================*/

public lr_check(id)
{
	if (get_user_team(id) != 1)
	{
		return PLUGIN_HANDLED
	}
	
	if(!is_user_alive(id))
	{
		return PLUGIN_HANDLED
	}
	if(lr_started)
	{
		return PLUGIN_HANDLED
	}
	
	new ctCount, trCount
	new players[32] = 0
	new pnum
	get_players(players, pnum, "a");
	for (new i = 0; i < g_max_clients; i++)
	{
		if (!is_user_alive(i))
		{
			continue;
		}
		
		switch (cs_get_user_team(i))
		{
			case CS_TEAM_CT:
			{
				ctCount++;
			}
			
			case CS_TEAM_T:
			{
				trCount++;
			}
		}
	}
	
	if (trCount > 1)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s There are^x03 to many prisoners left.", PREFIX)
		#else
			client_print(id, print_chat, "%s There are to many prisoners left.", PREFIX)
		#endif
		
		return PLUGIN_HANDLED;
	}
	
	if (ctCount == 0)
	{
		#if defined USE_CC
			ColorChat(id, RED, "%s Nu sunt^x03 oponenti", PREFIX)
		#else
			client_print(id, print_chat, "%s There are no opponents", PREFIX)
		#endif
		
		return PLUGIN_HANDLED;
	}
	if(cs_get_user_team(id) == CS_TEAM_T)	
	{	
		lr_menu(id)
	}
	return PLUGIN_HANDLED
}

public lr_menu(id)
{
	new lrmenu = menu_create("\yLast Request:", "sub_lr_menu")
		
	menu_additem(lrmenu, "\wJocuri", "1", 0);
	menu_additem(lrmenu, "\wObtiunile Rebelilor", "2", 0);
	
	menu_setprop(lrmenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, lrmenu, 0);

	return PLUGIN_HANDLED;
}	

public sub_lr_menu(id, lrmenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(lrmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(lrmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			gameslrmenu(id)
		}
		case 2: 
		{
			rebelmenu(id)
		}
	}
	
	menu_destroy(lrmenu);
	
	return PLUGIN_HANDLED;
}
		

/*==================================================================
				LR GAMES MENU
==================================================================*/

public gameslrmenu(id)
{	
	{
		new gamelrmenu = menu_create("\rLR:", "sub_gameslr_menu")
	
		menu_additem(gamelrmenu, "\wDuel Cutite", "1", 0);
		menu_additem(gamelrmenu, "\wDuel Deagle", "2", 0);
		menu_additem(gamelrmenu, "\wDuel Grenazi", "3", 0);
		menu_additem(gamelrmenu, "\wDuel Scout", "4", 0);
		menu_additem(gamelrmenu, "\wCursa", "5", 0);
		menu_additem(gamelrmenu, "\wDuel Tatuaje", "6", 0);
		menu_additem(gamelrmenu, "\wAruncare Degale", "7", 0);
		menu_additem(gamelrmenu, "\wDuel ShotGun", "8", 0);
		
		menu_setprop(gamelrmenu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, gamelrmenu, 0);
	}
	return PLUGIN_HANDLED
}

public sub_gameslr_menu(id, gamelrmenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(gamelrmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(gamelrmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
			lrgame[id] = LR_KNIFE
		
		case 2: 
			lrgame[id] = LR_S4S
		
		case 3: 
			lrgame[id] = LR_NADE
		
		case 4: 
			lrgame[id] = LR_SCOUT
		
		case 5: 
			lrgame[id] = LR_RACE
		
		case 6: 
			lrgame[id] = LR_SPRAY
		
		case 7:
			lrgame[id] = LR_TOSS
	
		case 8:
			lrgame[id] = LR_SHOTWAR
			
	}
	menu_destroy(gamelrmenu)
	playermenu(id)
	
	return PLUGIN_HANDLED;
}

/*=====================PLAYERMENU===========================*/
public playermenu(id)
{
	
	new menu = menu_create("\yChoose your opponent:", "submenu");
	
	new players[32], pnum, tempid;
	new szName[32], szTempid[10];
	
	get_players(players, pnum, "a");
	for(new i; i < pnum; i++)
	{
		tempid = players
		
		if (cs_get_user_team(tempid) != CS_TEAM_CT)
		{
			continue;
		}
		
		get_user_name(tempid, szName, 31);
		num_to_str(tempid, szTempid, 9);
		menu_additem(menu, szName, szTempid, 0);
	}
	
	menu_display(id, menu);
	return PLUGIN_HANDLED;
}

public submenu(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new tempid = str_to_num(data);
	
	new mapname[33]
	get_mapname(mapname, 32)
	
	new ct_origin[3], te_origin[3]
	
	switch(lrgame[id])
	{
		case LR_KNIFE:
		{	
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife");
			
			strip_user_weapons(id);
			set_user_health(id, 100);
			give_item(id, "weapon_knife");
			
			new szName[32], szName2[32];
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			
			client_print(0, print_center, "%s vs %s^n Duel Cutite", szName, szName2);
			
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			if(get_pcvar_num(cvar_teleport) && equali(mapname,"some1s_jailbreak"))
			{
				ct_origin[0] = -759, ct_origin[1] = 1047, ct_origin[2] = 100
				te_origin[0] = -585, te_origin[1] = 867, te_origin[2] = 100
				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)

			}
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
		}

		case LR_S4S:
		{
			strip_user_weapons(tempid)
			new iWep = give_item(tempid, "weapon_deagle")
			cs_set_weapon_ammo(iWep, 0)
			cs_set_user_bpammo(tempid, CSW_DEAGLE,0)
			
			strip_user_weapons(id)
			set_user_health(id, 100)
			new iWep2 = give_item(id, "weapon_deagle")    
			cs_set_weapon_ammo(iWep2, 1) 
			cs_set_user_bpammo(id, CSW_DEAGLE, 0)
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31)
			get_user_name(tempid, szName2, 31)
			
			client_print(0, print_center, "%s vs %s^n Duel Deagle",szName, szName2)   
			
			if( is_user_alive(tempid))
				set_user_health(tempid, 100);
				
			if(get_pcvar_num(cvar_teleport) && equali(mapname, "some1s_jailbreak"))
			{
				ct_origin[0] = -1352, ct_origin[1] = 271, ct_origin[2] = 38
				te_origin[0] = -1338, te_origin[1] = -782, te_origin[2] = 38

				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)
			}
			
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
			client_cmd(0, "mp3 play ^"%s^"", s4ssound)
			is_lr_s4s = true
		}

		case LR_NADE:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife")
			give_item(tempid, "weapon_hegrenade");
			cs_set_user_bpammo(tempid,CSW_HEGRENADE,50)
			
			strip_user_weapons(id)
			set_user_health(id, 100)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_hegrenade")
			cs_set_user_bpammo(id,CSW_HEGRENADE,50)
			
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Duel Grenazi",szName, szName2) 
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			if(get_pcvar_num(cvar_teleport) && equali(mapname,"some1s_jailbreak"))
			{
				ct_origin[0] = -1756, ct_origin[1] = -2526, ct_origin[2] = 36
				te_origin[0] = -3020, te_origin[1] = -2529, te_origin[2] = 36
				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)
			}
				
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
		}

		case LR_SCOUT:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_scout");
			give_item(tempid, "weapon_knife")
			cs_set_user_bpammo(tempid,CSW_SCOUT,10)
			
			strip_user_weapons(id)
			set_user_health(id, 100)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_scout")
			cs_set_user_bpammo(id,CSW_SCOUT,10)
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Duel Scout",szName, szName2)    
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
				
		
			if(get_pcvar_num(cvar_teleport) && equali(mapname,"some1s_jailbreak"))
			{
				ct_origin[0] = -2898, ct_origin[1] = -2040, ct_origin[2] = 37
				te_origin[0] = -2908, te_origin[1] = 905, te_origin[2] = 37
				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)
			}
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
		}
				
		case LR_RACE:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife");
			
			strip_user_weapons(id);
			set_user_health(id, 100);
			give_item(id, "weapon_knife");
			
			new szName[32], szName2[32];
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Cursa", szName, szName2);
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
				
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
			client_cmd(0, "mp3 play ^"%s^"", race_go)
		}
		
		case LR_SPRAY:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife");
			
			strip_user_weapons(id);
			set_user_health(id, 100);
			give_item(id, "weapon_knife");	

			new szName[32], szName2[32];
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center,  "%s vs %s^n Duel Tatuaje", szName, szName2);

			server_cmd("decalfrequency 0")
			spray_on = true
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
				
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
		}

		case LR_TOSS:
		{
			strip_user_weapons(tempid);
			new weapon = give_item(tempid, "weapon_deagle")
			give_item(tempid, "weapon_knife")
			cs_set_weapon_ammo(weapon, 0)
			cs_set_user_bpammo(tempid,CSW_DEAGLE, 0)
			
			strip_user_weapons(id);
			new weapon2 = give_item(id, "weapon_deagle")
			give_item(id, "weapon_knife")
			cs_set_weapon_ammo(weapon2, 0)
			cs_set_user_bpammo(id,CSW_DEAGLE, 0)
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Aruncare Degale",szName, szName2)    
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
				
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
		}

		case LR_SHOTWAR:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_m3");
			give_item(tempid, "weapon_knife")
			cs_set_user_bpammo(tempid,CSW_M3,100)
			
			strip_user_weapons(id)
			set_user_health(id, 255)
			give_item(id, "weapon_m3")
			give_item(id, "weapon_knife")
			cs_set_user_bpammo(id,CSW_M3,10)	
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Duel ShotGun",szName, szName2)    
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 255);
				
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
		}

	}
	menu_destroy(menu)
	lr_started = true
	return PLUGIN_HANDLED
}
/*================================================================
			LR REBELMENU
================================================================*/
public rebelmenu(id)
{	
	{
		new rebelingmenu = menu_create("\yRebel Options:", "sub_rebelmenu")
		
		menu_additem(rebelingmenu, "\wRambo", "1", 0);
		menu_additem(rebelingmenu, "\wDeagle Dude", "2", 0);
		menu_additem(rebelingmenu, "\wCrazy guy", "3", 0);
		menu_additem(rebelingmenu, "\wUber Glocker", "4", 0);
		
		menu_setprop(rebelingmenu, MPROP_EXIT, MEXIT_ALL);
		menu_display(id, rebelingmenu, 0);
	}
	
	return PLUGIN_HANDLED;
}

public sub_rebelmenu(id, rebelingmenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(rebelingmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(rebelingmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			strip_user_weapons(id)
			set_user_health(id, 250)
			give_item(id, "weapon_knife")
			give_item( id, "weapon_m249" );
			cs_set_user_bpammo(id,CSW_M249,300)

			set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
			show_hudmessage(0, "= RAMBO IS HERE =")
			lr_started = true
		}
		
		case 2: 
		{
			strip_user_weapons(id)
			set_user_health(id, 500)
			give_item(id, "weapon_knife")
			give_item( id, "weapon_deagle")
			cs_set_user_bpammo(id,CSW_DEAGLE,35)
			
			set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
			show_hudmessage(0, "= DEAGLE DUDE IS HERE =")
			lr_started = true
		}
		
		case 3: 
		{	
			strip_user_weapons(id)
			set_user_health(id, 1)
			give_item( id, "weapon_ak47")
			give_item(id, "weapon_knife")
			cs_set_user_bpammo(id,CSW_AK47,200)
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15)
			
			set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
			show_hudmessage(0, "= CRAZY GUY IS HERE =")
			lr_started = true
		}
		
		case 4: 
		{
			strip_user_weapons(id)
			set_user_health(id, 500)
			give_item( id, "weapon_glock18")
			give_item(id, "weapon_knife")
			cs_set_user_bpammo(id,CSW_GLOCK18,200)
			set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderTransAlpha, 255)
			
			set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
			show_hudmessage(0, "= UBER GLOCKER IS HERE =")
			lr_started = true
		}
	}
	
	menu_destroy(rebelingmenu);
	lrgame[id] = LR_REBEL
	return PLUGIN_HANDLED;
}
	
/*========================SHOT 4 SHOT BULLET==========================*/
public fw_primary_attack(ent)
{
    if(!is_lr_s4s)
        return HAM_IGNORED
    
    //Get owner of entity
    
    new id = pev(ent,pev_owner)
	
    //if he's not alive
    if(!is_user_alive(id))
    {
        return HAM_IGNORED
    }
    
    //If player is in lr and can shoot deagle
    if(lr_started)
    {
        //Search enemy
        new players[32], pnum, tempid
        get_players(players, pnum, "a")
        for(new i; i < pnum; i++)
        {
            tempid = players
            //if he's in lr and can't shoot deagle and is alive
            
            if(is_user_alive(tempid) && (id !=tempid))
			{
				gun_switch(id, tempid)
            }
        }
        return HAM_HANDLED
    }
    return HAM_IGNORED
}  

public gun_switch(id, tempid)
{
    if(!is_lr_s4s || !is_user_alive(id))
    {
        return PLUGIN_HANDLED
    }
	
    if(lr_started)
    {
            
        if(is_user_alive(tempid) && (id !=tempid) && !shot_deagle[id])
        {
			strip_user_weapons(tempid)
			new deagle = give_item(tempid, "weapon_deagle")
			cs_set_weapon_ammo(deagle, 1)
			cs_set_user_bpammo(tempid, CSW_DEAGLE, 0)
			
			shot_deagle[id] = true
			shot_deagle[tempid] = false
        }
    }
    return PLUGIN_HANDLED
}  

///////////////////////////////////////////////
//----------BEACON---------------------------//
///////////////////////////////////////////////

public beacon(id)
{
	if(/*!is_user_connected(id) || */!is_user_alive(id))
		return PLUGIN_HANDLED
		
	if(cs_get_user_team(id) == CS_TEAM_CT)
    {
        static origin[3]
        get_user_origin(id, origin)
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(TE_BEAMCYLINDER)    // TE id
        write_coord(origin[0])         // x
        write_coord(origin[1])        // y
        write_coord(origin[2]-20)    // z
        write_coord(origin[0])        // x axis
        write_coord(origin[1])        // y axis
        write_coord(origin[2]+200)    // z axis
        write_short(beacon_sprite)    // sprite
        write_byte(0)            // startframe   
        write_byte(1)            // framerate   
        write_byte(6)            // life
        write_byte(2)              // width
        write_byte(1)               // noise    
        write_byte(0)              // red  
        write_byte(0)               // green 
        write_byte(250)         // blue
        write_byte(200)            // brightness
        write_byte(0)            // speed
        message_end()
    }
	
	else if(cs_get_user_team(id) == CS_TEAM_T)
    {
        static origin[3]
        get_user_origin(id, origin)
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(TE_BEAMCYLINDER)    // TE id
        write_coord(origin[0])         // x
        write_coord(origin[1])        // y
        write_coord(origin[2]-20)    // z
        write_coord(origin[0])        // x axis
        write_coord(origin[1])        // y axis
        write_coord(origin[2]+200)    // z axis
        write_short(beacon_sprite)    // sprite
        write_byte(0)            // startframe   
        write_byte(1)            // framerate   
        write_byte(6)            // life
        write_byte(2)              // width
        write_byte(1)               // noise    
        write_byte(250)            // red  
        write_byte(0)               // green 
        write_byte(0)             // blue
        write_byte(200)            // brightness
        write_byte(0)            // speed
        message_end()
	}
	set_task(1.0, "beacon", id)

	return PLUGIN_HANDLED
}

///////////////////////////////////////////////
//----------T GAG BY Exolent[jNr]------------//
///////////////////////////////////////////////
public FwdSetVoice(receiver, sender, bool:listen)
{
    if(!get_pcvar_num(cvar_tvoiceblock))
        return PLUGIN_HANDLED
		
    if( !(1 <= receiver <= g_max_clients)
    || !g_connected[receiver]
    || !(1 <= sender <= g_max_clients)
    || !g_connected[sender] ) return FMRES_IGNORED;
    
    new CsTeams:team = cs_get_user_team(sender);
    if( (team == CS_TEAM_T || team == CS_TEAM_CT && !is_user_alive(sender)) && !access(sender, ADMIN_VOICE) )
    {
        engfunc(EngFunc_SetClientListening, receiver, sender, 0);
        return FMRES_SUPERCEDE;
    }
    
    return FMRES_IGNORED;
}  

//////////////////////////////////////////////
//------------WEAPON BLOCKER----------------//
//////////////////////////////////////////////
public Event_CurWeapon(id) 
{     
	new weaponID = read_data(2) 

	if(can_have_gun[id])
		return PLUGIN_CONTINUE
		
	if(weaponID != CSW_KNIFE)
		client_cmd(id, "weapon_knife")
	
	return PLUGIN_CONTINUE
}
Rapidserver
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

29 Dec 2013, 22:19

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <nvault>

#pragma tabsize 0

#define USE_CC

#if defined USE_CC
#include <colorchat>
#endif

///////////////
// =Defines= //
///////////////

#define VERSION "3.2"

#define IsPlayer(%1) (1<=%1<=g_max_clients)

#define REQUIRED_ADMIN_LEVEL ADMIN_KICK
#define ADMIN_VOICE ADMIN_MENU

#define OFFSET_PRIMARYWEAPON        116 

/////////////////////////////////////////////////////////


//////////////////
// =New things= //
//////////////////
#if defined USE_CC
new const PREFIX[] = "[JailBreak]^x04:" // Prefix 
#else
new const PREFIX[] = "[JailBreak]:" // Normal prefix
#endif

new g_max_clients		//client check

//	Cvars	
new cvar_killpoints		// How many Cookies a terrorist gets for 1 ct kill
new cvar_gunprice		// How many Cookies a gun costs
new cvar_pillsprice		// How many Cookies pills costs
new cvar_armorprice		// How many Cookies armor costs
new cvar_camoprice		// How many Cookies camo costs
new cvar_nadepackprice	// How many Cookies nades cost
new cvar_headshotpoints	// How many extra points a t gets for killing a ct
new cvar_days			// Is days hud should be displayed or not
new cvar_showplayers	// Shows the players in a nice hud message
new cvar_shop			// Open or close the shop
new cvar_showrebels		// Show rebels in chat
new cvar_tvoiceblock 	// Block T's from using voicechat
new cvar_daysmenu		// Enables the days menu
new cvar_teleport		// Enables/disables teleport on LR

//   Points system 	
new playerpoints[33]	// Amount of Cookies a player has
new g_vault				// Open a new vault to store a players points.

//	 Other Stuff
new days

new g_guards
new g_prisoners

new beacon_sprite

new lrgame[33]
enum 
{
LR_NONE,
LR_KNIFE,
LR_S4S,
LR_NADE,
LR_SCOUT,
LR_RACE,
LR_SPRAY,
LR_TOSS,
LR_SHOTWAR,
LR_SPECIAL,
LR_REBEL
}

new specialday[21]
enum
{
DAY_NONE,
DAY_MUSIC,
DAY_GRAV,
DAY_FREEDAY,
DAY_ZOMBIE,
DAY_LAVA,
DAY_SHARK,
DAY_CAGE,
DAY_DM,
DAY_NIGHT,
DAY_SPARTAN,
DAY_FOOTBALL
}

// Sounds
new musicday_song[] 	= "sound/musicday1.mp3"
new musicday_song2[] 	= "sound/musicday2.mp3"
new musicday_song3[]	= "sound/musicday3.mp3"
new alarm[] 			= "sound/misc/alarm.mp3"
new race_go[] 			= "sound/jailbreak/race_go.mp3"
new s4ssound[] 			= "sound/jailbreak/s4s.mp3"
new spartansound[] 		= "sound/jailbreak/spartan_day.mp3"
new zombiesound[] 		= "sound/jailbreak/zombie_day.mp3"

new timer
new name[33]

////////////////////////////////////////////////////////////////

////////////////
// =Booleans= //
////////////////

new bool: lr_started			// Is last request?
new bool: got_camo[33]			// Does player got camo?
new bool: gravityday			// Is today a gravity day?	
new bool: spray_on				// Is spray contest on?
new bool: is_lr_s4s				// Is lr shot 4 shot?
new bool: shot_deagle[33]		// Did he shoot his deagle?
new bool: is_rebel[33]			// Is the player a rebel?
new bool: can_have_gun[33]  	// Can he have a gun?
new bool: lr_next_special[33]	// Specialday next round
new bool: got_name = false		// Got the players name on cd?
new bool: countdown_on = false	// Is counting down?

new bool:g_connected[33]



///////////////////////////////////////////////////////////////

//////////////
// =Stocks= //
//////////////

stock check_user(index)
{
if(!is_user_connected(index) ||(is_user_bot(index)))
{
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

stock strip_weapons(index)
{

strip_user_weapons(index)
set_pdata_int(index, OFFSET_PRIMARYWEAPON, 0)
give_item(index, "weapon_knife")
} 

//////////////////////////////////////////////////////////////
//---------------PLUGIN INIT--------------------------------//
//////////////////////////////////////////////////////////////

public plugin_init()
{
register_plugin("CF Jailbreak", VERSION, "Drekes")

//cvars
cvar_killpoints = register_cvar("jb_points_kill", "2")
cvar_gunprice = register_cvar("jb_shop_gunprice", "8")
cvar_pillsprice = register_cvar("jb_shop_pillsprice", "7")
cvar_armorprice = register_cvar("jb_shop_armorprice", "4")
cvar_camoprice = register_cvar("jb_shop_camoprice", "10")
cvar_showplayers = register_cvar("jb_show_players", "1")
cvar_days = register_cvar("jb_days", "1")
cvar_shop = register_cvar("jb_shop", "1")
cvar_headshotpoints = register_cvar("jb_points_headshot", "2")
cvar_nadepackprice = register_cvar("jb_shop_nadepack_price", "5")
cvar_showrebels = register_cvar("jb_show_rebels", "1")
cvar_tvoiceblock = register_cvar("jb_blocktvoice", "1")
cvar_daysmenu = register_cvar("jb_enable_days", "1")
cvar_teleport = register_cvar("jb_teleport", "0")

register_cvar("cfjail_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)

RegisterHam(Ham_Spawn, "player", "Event_Playerspawn", 1)
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_deagle", "fw_primary_attack")
RegisterHam(Ham_TakeDamage, "player", "Event_TakeDamage")

register_forward(FM_Voice_SetClientListening, "FwdSetVoice");

//Events
register_event("DeathMsg", "Event_Deathmsg", "a")
register_logevent("Event_Roundend", 2, "1=Round_End") 
register_logevent("Event_Roundstart", 2, "1=Round_Start")
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")


//client commands
register_clcmd("say /lr", "lr_check")
register_clcmd("say !lr", "lr_check")
register_clcmd("say /rules", "showrules")
register_clcmd("say_team /rules", "showrules")
register_clcmd("say /shop", "cmd_shop")
register_clcmd("say_team /shop", "cmd_shop")
register_clcmd("say /daysmenu", "specialday_check")
register_concmd("say /countdown", "cdmenu")

//Console (admin) Commands
register_concmd("amx_take_points", "cmd_take_points", ADMIN_KICK, "<target> <amount>")
register_concmd("amx_give_points", "cmd_give_points", ADMIN_KICK, "<target> <amount>")

//Other Things
g_max_clients = get_maxplayers()

g_vault = nvault_open("jbpoints")	// Open a vault for the points

set_task(1.0, "players_hud", 0, _, _, "b")
}

///////////////////////////////////////////////////
//--------------PRECACHE-------------------------//
///////////////////////////////////////////////////
public plugin_precache()
{
precache_generic(musicday_song)
precache_generic(musicday_song2)
precache_generic(musicday_song3)
precache_generic(alarm)
precache_generic(race_go)
precache_generic(s4ssound)
precache_generic(spartansound)
precache_generic(zombiesound)

precache_sound("fvox/one.wav")
precache_sound("fvox/two.wav")
precache_sound("fvox/three.wav")
precache_sound("fvox/four.wav")
precache_sound("fvox/five.wav")
precache_sound("fvox/six.wav")
precache_sound("fvox/seven.wav")
precache_sound("fvox/eight.wav")
precache_sound("fvox/nine.wav")
precache_sound("fvox/ten.wav")
precache_sound("fvox/eleven.wav")
precache_sound("fvox/twelve.wav")
precache_sound("fvox/thirteen.wav")
precache_sound("fvox/fourteen.wav")
precache_sound("fvox/fifteen.wav")
precache_sound("radio/com_go.wav")

precache_model("models/player/gign/gign.mdl")

beacon_sprite = precache_model("sprites/shockwave.spr")
}
///////////////////////////////////////////////////
//-------------PLAYER SPAWN----------------------//
///////////////////////////////////////////////////
public Event_Playerspawn(id)
{
if(!IsPlayer(id))
return PLUGIN_HANDLED

if(is_user_alive(id))
{
	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		strip_weapons(id)
		gun_check(id)
	}
	
	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		if(got_camo[id])
		{
			cs_reset_user_model(id)
			got_camo[id] = false
		}
		
		if(lr_next_special[id])
		{
			specialday_menu(id)
			lr_next_special[id] = false
		}
		
		if(is_rebel[id])
			unrebel(id)
			
			strip_weapons(id)
			lr_started = false
			is_rebel[id] = false
			lrgame[id] = LR_NONE
		}
		can_have_gun[id] = true
		set_user_rendering(id)
	}
	specialday[20] = DAY_NONE
	return PLUGIN_HANDLED
}

//////////////////////////////////////////////////////////////////
//--------------------PLAYER DEATH------------------------------//
//////////////////////////////////////////////////////////////////
public Event_Deathmsg()
{
	new attacker = read_data(1)
	new victim = read_data(2)
	new headshot = read_data(3)
	
	new AttackerName[32]
	new VictimName[32]
	
	get_user_name(attacker, AttackerName, 31)
	get_user_name(victim, VictimName,31)
	
	if(!IsPlayer(attacker))
		return PLUGIN_HANDLED
	
	if(!IsPlayer(victim))
		return PLUGIN_HANDLED
	
	if( cs_get_user_team(attacker) == CS_TEAM_CT && cs_get_user_team(victim) == CS_TEAM_T)
	{
		if(get_pcvar_num(cvar_showrebels) && !lr_started)
		{
			if(!is_rebel[victim])
			{
				#if defined USE_CC
				ColorChat(0, RED, "%s Gradianul^x03 %s^x04 L-a omorat pe^x03 %s!", PREFIX, AttackerName, VictimName)
				#else
				client_print(0, print_chat, "%s Guard %s killed prisoner %s!", PREFIX, AttackerName, VictimName)
				#endif
			}
			
			else
			{
				#if defined USE_CC
				ColorChat(0, RED, "%s Gardianul^x03 %s^x04 L-a omorat pe rebelul^x03 %s!", PREFIX, AttackerName, VictimName)
				#else
				client_print(0, print_chat, "%s Guard %s killed rebel %s", PREFIX, AttackerName, VictimName)
				#endif
				unrebel(victim)
			}
		}
	}
	
	if( cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
	{
		playerpoints[attacker] += get_pcvar_num(cvar_killpoints)
		
		if(headshot)
			playerpoints[attacker] += get_pcvar_num(cvar_headshotpoints);
		
		if(lr_started)
		{
			if(is_lr_s4s)
				is_lr_s4s = false
			
			if(lrgame[attacker] != LR_REBEL)
				strip_weapons(attacker)
			
			lr_started = false
			lrgame[attacker] = LR_NONE
		}
	}
	
	if(spray_on)
	{
		server_cmd("decalfrequency 20")
		spray_on = false
	}
	
	if(task_exists(attacker))
		remove_task(attacker)
	
	if(task_exists(victim))
		remove_task(victim)
	
	SaveData(attacker)
	
	return PLUGIN_HANDLED
}  

////////////////////////////////////////////////////////////
//-----------------ROUND END/ ROUND START-----------------//
////////////////////////////////////////////////////////////
public Event_Roundend()
{
	if(gravityday)
	{
		server_cmd("sv_gravity 800")
		gravityday = false
	}
	
	if(specialday[20] == DAY_DM)
		server_cmd("mp_friendlyfire 0")
	
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
}	
public Event_Roundstart()
{
	if(get_pcvar_num(cvar_days))
	{
		days ++
	}
	if(get_pcvar_num(cvar_showplayers))
	{
		g_guards = 0
		g_prisoners = 0
	}
}

/////////////////////////////////////////////////////
//-----------------TAKE DAMAGE---------------------//
/////////////////////////////////////////////////////
public Event_TakeDamage(victim, weapon, attacker, float: damage, damagebits)
{
	if(IsPlayer(victim) && IsPlayer(attacker))
	{
		if(get_pcvar_num(cvar_showrebels) && !is_rebel[attacker] && !lr_started && IsPlayer(attacker) && IsPlayer(victim))
		{
			if(victim != attacker && attacker != 0)
			{
				if(cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
				{
					make_rebel(attacker, victim)
				}
			}
		}
	}
}

/////////////////////////////////////////////////////
//-----------------PLAYER DISCONNECTS--------------//
/////////////////////////////////////////////////////
public client_disconnect(id)
{
	SaveData(id) 
	g_connected[id] = false;
}

//////////////////////////////////////////////////////
//----------------CLIENT PUTINSERVER----------------//
//////////////////////////////////////////////////////
public client_putinserver(id)  
	g_connected[id] = true;
//////////////////////////////////////////////////////
//-----------------SOMETHING ELSE-------------------//
//////////////////////////////////////////////////////
public Player_Jump(id)
{
	if( is_user_alive(id) && entity_get_float(id, EV_FL_fuser2) > 0.0 )
	{
		entity_set_float(id, EV_FL_fuser2, 0.0)
	}
}


//////////////////////////////////////////////////////
//-----------ON MAP CHANGE OR SERVER CRASH----------//
//////////////////////////////////////////////////////
public plugin_end()
{
	nvault_close(g_vault)
}

//////////////////////////////////////////////////////
//---------------CT GUN MENU------------------------//
//////////////////////////////////////////////////////
public gun_check(id)
{
	if(IsPlayer(id) && cs_get_user_team(id) == CS_TEAM_CT)
	{
		primgun_menu(id)
	}
	return PLUGIN_HANDLED
}

//////////////////////////////////////////////////////
//----------------MAKE REBEL------------------------//
//////////////////////////////////////////////////////
public make_rebel(attacker, victim)
{
	new attackername[33], victimname[33]
	get_user_name(attacker, attackername, 32)
	get_user_name(victim, victimname, 32)
	
	#if defined USE_CC
	ColorChat(0, RED, "%s^x03 %s^x04 L-a atacat pe^x03 %s^x04 Si acum este un rebel", PREFIX, attackername, victimname)
	#else
	client_print(0, print_chat, "%s %s attacked %s and is now a rebel!", PREFIX, attackername, victimname)
	#endif
	
	set_user_rendering(attacker, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16)
	client_cmd(0, "mp3 play ^"%s^"", alarm)
	is_rebel[attacker] = true
}

/////////////////////////////////////////////////////
//--------------UNDO REBEL-------------------------//
/////////////////////////////////////////////////////
public unrebel(id)
{
	if(is_user_connected(id))
	{
		set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 255)
		is_rebel[id] = false
	}
}
/*========================PRIMARY WEAPON======================*/

public primgun_menu(id)
{	
	if(!IsPlayer(id))
		return PLUGIN_HANDLED
	
	new primgunmenu = menu_create("\yAlege-ti Echipamentul:", "sub_primgun_menu")
	
	menu_additem(primgunmenu, "\rFortele Americane(M4A1+Deagle)", "1", 0);
	menu_additem(primgunmenu, "\rFortele Arabe(AK47+Deagle)", "2", 0);
	menu_additem(primgunmenu, "\rFortele Germane(AWP+Deagle)", "3", 0);
	menu_additem(primgunmenu, "\rFortele Romane(MP5+Deagle)", "4", 0);
	menu_additem(primgunmenu, "\rFortele Britanice(XM1014+Degale)", "5", 0);
	menu_additem(primgunmenu, "\rFortele Italiene(SG550+Degale)", "6", 0);
	
	menu_setprop(primgunmenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, primgunmenu, 0);
	return PLUGIN_HANDLED
}	

public sub_primgun_menu(id, primgunmenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(primgunmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(primgunmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			primgun1(id)
		}
		case 2: 
		{
			primgun2(id)
		}
		case 3:
		{
			primgun3(id)
		}
		case 4:
		{
			primgun4(id)
		}
		case 5:
		{
			primgun5(id)
		}
		case 6:
		{
			primgun6(id)
		}
	}
	
	menu_destroy(primgunmenu);
	return PLUGIN_HANDLED;
}

public primgun1(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_deagle" )
	give_item( id, "weapon_m4a1" )
	cs_set_user_bpammo( id, CSW_M4A1, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}

public primgun2(id)
{
	give_item( id, "weapon_knife" )
	give_item(id, "weapon_ak47")
	give_item(id, "weapon_usp")
	cs_set_user_bpammo(id, CSW_USP, 100)
	cs_set_user_bpammo(id, CSW_AK47, 200)
}

public primgun3(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_deagle" )
	give_item( id, "weapon_awp" )
	cs_set_user_bpammo( id, CSW_AWP, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}

public primgun4(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_mp5navy" )
	give_item( id, "weapon_deagle" )
	cs_set_user_bpammo( id, CSW_MP5NAVY, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}	

public primgun5(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_xm1014" )
	give_item( id, "weapon_deagle" )
	cs_set_user_bpammo( id, CSW_XM1014, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}
public primgun6(id)
{
	give_item( id, "weapon_knife" )
	give_item( id, "weapon_sg550" )
	give_item( id, "weapon_deagle" )
	cs_set_user_bpammo( id, CSW_SG550, 200 )
	cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
}
///////////////////////////////////////////////////////////////
//--------------------RULES MOTD-----------------------------//
///////////////////////////////////////////////////////////////
public showrules(id)
{
	show_motd(id, "jailrules.txt", "Jailbreak Rules")
}

//////////////////////////////////////////////////////////////////
//----------------POINTS SAVE AND LOAD--------------------------//
//////////////////////////////////////////////////////////////////
public SaveData(id) 
{  
	new authid[32];
	get_user_authid(id,authid,31);
	
	new vaultkey[64], vaultdata[64];
	
	//Save their points     
	format(vaultkey,63,"jb-%s-points",authid);     
	format(vaultdata,63,"%d",playerpoints[id]);     
	set_vaultdata(vaultkey,vaultdata);  
}

public LoadData(id) 
{
	new authid[32]; 
	get_user_authid(id,authid,31); 
	
	new vaultkey[64], vaultdata[64]; 
	//Load their points
	format(vaultkey,63,"jb-%s-points",authid); 
	get_vaultdata(vaultkey,vaultdata,63); 
	playerpoints[id] = str_to_num(vaultdata); 
}

//////////////////////////////////////////////////////////////
//----------------THE SHOP----------------------------------//
//////////////////////////////////////////////////////////////
public cmd_shop(id)
{
	if(!get_pcvar_num(cvar_shop))
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s We are currently working on the shop, it will be opened soon.", PREFIX)
		#else
		client_print(id, print_chat, "%s We are currently working on the shop, it will be opened soon.", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	if(cs_get_user_team(id) != CS_TEAM_T)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s Only^x03 prisoners^x04 can use the shop", PREFIX)
		#else
		client_print(id, print_chat, "%s Only prisoners can use the shop!", PREFIX)
		#endif
		
		return PLUGIN_HANDLED;
	}
	
	if(lr_started)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s You can use the shop while last request is activated", PREFIX)
		#else
		client_print(id, print_chat, "%s You can't use the shop while last request is activated!", PREFIX)
		#endif
		
		return PLUGIN_CONTINUE
	}
	
	if(is_rebel[id])
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s Detinutii rebeli nu pot folosii shopul.", PREFIX)
		#else
		client_print(id, print_chat, "%s Rebels can't use the shop!", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(!is_user_alive(id))
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s Trebuie sa fi in^x03 viata^x04 pentru a folosii shopul.", PREFIX)
		#else
		client_print(id, print_chat, "%s You must be alive to use the shop!", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	else if(cs_get_user_team(id) == CS_TEAM_T)
	{
		shopmenu(id)
	}
	return PLUGIN_HANDLED
}

public shopmenu(id)
{
	if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
	{
		new szText[555 char]
		new points = playerpoints[id]
		
		formatex(szText, charsmax(szText), "Shop pe Prajituri^nPrajiturile tale: %d", points)
		new shopmenu = menu_create(szText, "sub_shopmenu")
		
		formatex(szText, charsmax(szText), "Deagle/Mori: %d Cookies", get_pcvar_num(cvar_gunprice))
		menu_additem(shopmenu, szText, "1", 0)
		
		formatex(szText, charsmax(szText), "Marihuana: %d Cookies", get_pcvar_num(cvar_pillsprice))
		menu_additem(shopmenu, szText, "2" , 0)
		
		formatex(szText, charsmax(szText), "Armor: %d Cookies", get_pcvar_num(cvar_armorprice))
		menu_additem(shopmenu, szText, "3", 0)
		
		formatex(szText, charsmax(szText), "Skin Gardian: %d Cookies", get_pcvar_num(cvar_camoprice))
		menu_additem(shopmenu, szText, "4", 0)
		
		formatex(szText, charsmax(szText), "Pachet Grenazi: %d Cookies", get_pcvar_num(cvar_nadepackprice))
		menu_additem(shopmenu, szText, "5", 0)
		
		menu_setprop(shopmenu, MPROP_EXIT , MEXIT_ALL);
		menu_display(id, shopmenu, 0);
	}
	return PLUGIN_HANDLED
}

public sub_shopmenu(id, shopmenu, item)  
{
	if (item == MENU_EXIT)
	{
		menu_destroy(shopmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(shopmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_gunprice))
			{
				#if defined USE_CC
				ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
				client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif
				
				return PLUGIN_HANDLED
			}
			
			else
			{
				gun_gamble(id)
			}
		}
		
		case 2: 
		{
			if(playerpoints[id] < get_pcvar_num(cvar_pillsprice))
			{
				#if defined USE_CC
				ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
				client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif
				
				return PLUGIN_HANDLED
			}
			
			else
			{
				give_pills(id)
			}
		}
		
		case 3:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_armorprice))
			{
				#if defined USE_CC
				ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
				client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif			
				
				return PLUGIN_HANDLED
			}
			
			else
			{
				give_armor(id)
			}
		}
		
		case 4:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_camoprice))
			{
				#if defined USE_CC
				ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
				client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif			
				
				return PLUGIN_HANDLED
			}
			
			else
			{
				give_camo(id)
			}
		}
		
		case 5:
		{
			if(playerpoints[id] < get_pcvar_num(cvar_nadepackprice))
			{
				#if defined USE_CC
				ColorChat(id, RED, "%s Nu ai destule^x03 Prajituri^x04 Pentru a cumpara acest item", PREFIX)
				#else
				client_print(id, print_chat, "%s You don't got enough Cookies to buy that item", PREFIX)
				#endif			
				
				return PLUGIN_HANDLED
			}
			
			else
			{
				give_nadepack(id)
			}
		}
	}
	menu_destroy(shopmenu);
	return PLUGIN_HANDLED;
}

public gun_gamble(id)
{
	if(random_num(1, 3) == 1)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s Ai avut nororc^x03 si ai primit pistolul!", PREFIX)
		#else
		client_print(id, print_chat, "%s You gambled for a pistol and you got it!", PREFIX)
		#endif
		
		give_item(id, "weapon_deagle");
	}
	
	else
	{
		user_kill(id)
		
		#if defined USE_CC
		ColorChat(id, RED, "%s Nu ai avut noroc si ai^x03 murit", PREFIX)
		#else
		client_print(id, print_chat, "%s You gambled for a pistol and died.", PREFIX)
		#endif
	}	
	
	playerpoints[id] -= get_pcvar_num(cvar_gunprice)
	
	return PLUGIN_HANDLED
}

public give_pills(id)
{
	new health = get_user_health(id) + 50
	
	set_user_health(id, health)
	
	#if defined USE_CC
	ColorChat(id, RED, "%s Ai cumparat^x03 Marihuana.", PREFIX)
	#else
	client_print(id, print_chat, "%s You bought pills.", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_pillsprice)
	
	return PLUGIN_HANDLED
}

public give_armor(id)
{
	new armor = get_user_armor(id) + 50
	
	set_user_armor(id, armor)
	
	#if defined USE_CC
	ColorChat(id, RED, "%s Ai cumparat^x03 Armura.", PREFIX)
	#else
	client_print(id, print_chat, "%s You bought armor.", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_armorprice) 
	
	return PLUGIN_HANDLED
}

public give_camo(id)
{
	set_user_info(id, "model", "jbemodel");
	entity_set_int(id, EV_INT_body, 3);
	got_camo[id] = true
	
	#if defined USE_CC
	ColorChat(id, RED, "%s Ai cumparat^x03 Skin Gardian.", PREFIX)
	#else
	client_print(id, print_chat, "%s You bought camo.", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_camoprice)
	
	return PLUGIN_HANDLED
}

public give_nadepack(id)
{
	give_item(id, "weapon_flashbang")
	give_item(id, "weapon_hegrenade")
	give_item(id, "weapon_smokegrenade")	
	
	#if defined USE_CC
	ColorChat(id, RED, "%s Ai cumparat^x03 Pachet de Grenazi", PREFIX)
	#else
	client_print(id, print_chat, "%s you bought a nade pack", PREFIX)
	#endif
	
	playerpoints[id] -= get_pcvar_num(cvar_nadepackprice)
	
	return PLUGIN_HANDLED
}

////////////////////////////////////////////////////////////////////
//--------------------GIVE/TAKE POINTS----------------------------//
////////////////////////////////////////////////////////////////////
public cmd_give_points(id,level,cid)
{
	if(!cmd_access(id,level,cid,3))
		return PLUGIN_HANDLED;
	
	new target[32], amount[21], reason[21];
	
	read_argv(1, target, 31 );
	read_argv(2, amount, 20 );
	read_argv( 3, reason, 20 );
	
	new player = cmd_target( id, target, 8 );
	
	if( ! player ) 
		return PLUGIN_HANDLED;
	
	new admin_name[32], player_name[32];
	get_user_name(id, admin_name, 31);
	get_user_name(player, player_name, 31);
	
	new pointnum = str_to_num(amount);
	
	playerpoints[player] += pointnum;
	
	switch(get_cvar_num ("amx_show_activity"))
	{
		case 1: client_print( 0, print_chat, "%s ADMIN: gave %i points for %s.",PREFIX, pointnum, player_name );
			case 2: client_print( 0, print_chat, "%s ADMIN %s: gave %i points for %s.",PREFIX, admin_name, pointnum, player_name );
		}
	
	client_print(player, print_chat, "%s You received %i points.(Total: %d)",PREFIX, pointnum, playerpoints[player]);
	
	SaveData( id )
	
	return PLUGIN_CONTINUE;
}

public cmd_take_points(id,level,cid)
{
	if(!cmd_access (id, level, cid, 3))
		return PLUGIN_HANDLED;
	
	new target[32], amount[21], reason[21];
	
	read_argv( 1, target, 31 );
	read_argv( 2, amount, 20 );
	read_argv( 3, reason, 20 );
	
	new player = cmd_target( id, target, 8 );
	
	if(!player ) 
		return PLUGIN_HANDLED;
	
	new admin_name[32], player_name[32];
	get_user_name( id, admin_name, 31 );
	get_user_name( player, player_name, 31 );
	
	new pointnum = str_to_num( amount );
	
	playerpoints[player] -= pointnum;
	
	switch(get_cvar_num("amx_show_activity"))
	{
		case 1: client_print( 0, print_chat, "%s ADMIN: took %i points from %s.",PREFIX,  pointnum, player_name );
			case 2: client_print( 0, print_chat, "%s ADMIN %s: took %i points from %s.",PREFIX, admin_name, pointnum, player_name );
		}
	
	client_print( player, print_chat, "You lost %i points. (Total: %d)", pointnum, playerpoints[player] );
	
	SaveData( id )
	
	return PLUGIN_CONTINUE;
}

/////////////////////////////////////////////////////////////
//--------------------COUNTDOWN STUFF----------------------//
/////////////////////////////////////////////////////////////
public cdmenu(id)
{
	if(get_user_team(id) != 2)
	{
		#if defined USE_CC
		ColorChat(id, RED, "Only^x03 Counter-terrorists^x04 can start a^x03 countdown", PREFIX)
		#else
		client_print(id, print_chat, "%s Only Counter-terrorist can start a countdown", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(countdown_on)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s There is already a^x03 countdown^x04 on", PREFIX)
		#else
		client_print(id, print_chat, "%s There is already a countdown on", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	new menu = menu_create("\yCountDown Menu", "menu_handler")
	
	menu_additem(menu, "\w5 Seconds", "1", 0)
	menu_additem(menu, "\w10 Seconds", "2", 0)
	menu_additem(menu, "\w15 Seconds", "3", 0)
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, menu, 0)
	
	return PLUGIN_HANDLED
}

public menu_handler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new Data[7], Name[64]
	new Access, Callback
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, Callback)
	
	new Key = str_to_num(Data)
	
	switch(Key)
	{
		case 1:
		{
			timer = 5
		}
		
		case 2:
		{
			timer = 10
		}
		
		case 3:
		{
			timer = 15
		}
	}
	countdown_on = true
	got_name = false
	countdown(id)
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

public countdown(id)
{
	if(!got_name)
		get_user_name(id, name, 32)
	
	switch(timer)
	{
		case 0:
		{
			set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 3.0)
			show_hudmessage(0, "Go go go")
			client_cmd(0, "spk ^"sound/radio/com_go.wav^"")
			countdown_on = false
		}
		
		case 1:
		{
			client_cmd(0, "spk ^"fvox/one.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 2:
		{
			client_cmd(0, "spk ^"fvox/two.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 3:
		{
			client_cmd(0, "spk ^"fvox/three.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 4:
		{
			client_cmd(0, "spk ^"fvox/four.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 5:
		{
			client_cmd(0, "spk ^"fvox/five.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 6:
		{
			client_cmd(0, "spk ^"fvox/six.wav^"")
			set_task(1.0, "countdown", 0)
		}
		case 7:
		{
			client_cmd(0, "spk ^"fvox/seven.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 8:
		{
			client_cmd(0, "spk ^"fvox/eight.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 9:
		{
			client_cmd(0, "spk ^"fvox/nine.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 10:
		{
			client_cmd(0, "spk ^"fvox/ten.wav^"")		
			set_task(1.0, "countdown", 0)
		}
		
		case 11:
		{
			client_cmd(0, "spk ^"fvox/eleven.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 12:
		{
			client_cmd(0, "spk ^"fvox/twelve.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 13:
		{
			client_cmd(0, "spk ^"fvox/thirteen.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 14:
		{
			client_cmd(0, "spk ^"fvox/fourteen.wav^"")
			set_task(1.0, "countdown", 0)
		}
		
		case 15:
		{
			client_cmd(0, "spk ^"fvox/fifteen.wav^"")
			set_task(1.0, "countdown", 0)
		}
	}
	
	if(timer != 0)
	{
		set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 3.0)
		show_hudmessage(0, "%s started countdown: %i", name, timer)
		timer--
	}
	got_name = true
}

/////////////////////////////////////////////////////////////
//-----------------THE DAYS MENU---------------------------//
/////////////////////////////////////////////////////////////
public specialday_check(id)
{
	if(!get_pcvar_num(cvar_daysmenu))
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s Days are^x03 disabled", PREFIX)
		#else
		client_print(id, print_chat, "%s Days are disabled", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(get_user_team(id) != 2)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s Numai^x03 Gardienii^x04 pot porni^x03 o zi speciala", PREFIX)
		#else
		client_print(id, print_chat, "%s Only CT's can start a special day", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(!is_user_alive(id))
	{	
		#if defined USE_CC
		ColorChat(id, RED, "%s Trebuie sa fi^x03 in viata^x04 pentru a da^x03 o zi speciala", PREFIX)
		#else
		client_print(id, print_chat, "%s You have to be alive to start a special day", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	if(specialday[20] != DAY_NONE)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s There is already a day chosen", PREFIX)
		#else
		client_print(id, print_chat, "%s There is already a day chosen", PREFIX)
		#endif
		
		return PLUGIN_HANDLED
	}
	
	specialday_menu(id)
	return PLUGIN_HANDLED
}

public specialday_menu(id)
{
	new specialdaymenu = menu_create("\ySpecial Days:", "specialday_submenu")
	
	menu_additem(specialdaymenu, "\wMusic Day", "1", 0);
	menu_additem(specialdaymenu, "\wGravity Day", "2", 0);
	menu_additem(specialdaymenu, "\wMoartea Cocosului", "3", 0);
	menu_additem(specialdaymenu, "\wZombie Day", "4", 0);
	menu_additem(specialdaymenu, "\wLava Day", "5", 0);
	menu_additem(specialdaymenu, "\wShark Day", "6", 0);
	menu_additem(specialdaymenu, "\wCage Day", "7", 0);
	menu_additem(specialdaymenu, "\wDeathMatch Day", "8", 0);
	menu_additem(specialdaymenu, "\wNight Crawler Day", "9", 0)
	menu_additem(specialdaymenu, "\wSpartan Day", "10", 0)
	
	menu_setprop(specialdaymenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, specialdaymenu, 0);
}

public specialday_submenu(id, specialdaymenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(specialdaymenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(specialdaymenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
			specialday[20] = DAY_MUSIC
		
		case 2:
			specialday[20] = DAY_GRAV
		
		case 3:
			specialday[20] = DAY_FREEDAY
		
		case 4:
			specialday[20] = DAY_ZOMBIE
		
		case 5:
			specialday[20] = DAY_LAVA
		
		case 6:
			specialday[20] = DAY_SHARK
		
		case 7:
			specialday[20] = DAY_CAGE
		
		case 8:
			specialday[20] = DAY_DM
		
		case 9:
			specialday[20] = DAY_NIGHT
		
		case 10:
			specialday[20] = DAY_SPARTAN
		
		case 11:
			specialday[20] = DAY_FOOTBALL
		
	}	
	
	if(IsPlayer(id) && is_user_alive(id))
		do_specialday(id)
	
	menu_destroy(specialdaymenu);
	return PLUGIN_HANDLED
}

public do_specialday(id)
{
	for(new i = 0; i < g_max_clients; i++)
	{
		switch(specialday[20])
		{
			case DAY_MUSIC:
			{
				new musicmenu = menu_create("\yMusic Choice", "musicday_submenu")
				
				menu_additem(musicmenu, "\wPorneste Muzica", "1", 0)
				menu_additem(musicmenu, "\wOpreste Muzica", "2", 0)
				
				menu_setprop(musicmenu,MPROP_EXIT, MEXIT_ALL)
				menu_display(id, musicmenu, 0)
			}
			
			case DAY_GRAV:
			{
				server_cmd("sv_gravity 200")
				
				#if defined USE_CC
				ColorChat(0, RED, "%s Astazi este^x03 Gravity day", PREFIX)
				#else
				client_print(0, print_chat, "%s Today is Gravity day", PREFIX)
				#endif
				
				gravityday = true
			}
			case DAY_FREEDAY:
			{
				switch(cs_get_user_team(i))
				{
					case 1:
					{
						give_item(i, "weapon_ak47")
						give_item(i, "weapon_m4a1")
						give_item(i, "weapon_awp")
						
						
						cs_set_user_bpammo(i, CSW_AK47, 200)
						cs_set_user_bpammo(i, CSW_M4A1, 200)
						cs_set_user_bpammo(i, CSW_AWP, 200)
					}
					case 2:
					{	
						give_item(i, "weapon_ak47")
						give_item(i, "weapon_m4a1")
						give_item(i, "weapon_awp")
						
						cs_set_user_bpammo(i, CSW_AK47, 200)
						cs_set_user_bpammo(i, CSW_M4A1, 200)
						cs_set_user_bpammo(i, CSW_AWP, 200)	
					}
				}
					
					#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este^x03 GunDay", PREFIX)
					#else
					client_print(0, print_chat, "%s Today is Freeday", PREFIX)
					#endif
			}
			
			case DAY_ZOMBIE:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{	
					switch(cs_get_user_team(i))
					{
						case 1:
						{
							set_user_health(i, 150)
							
							give_item(i, "weapon_ak47")
							give_item(i, "weapon_m4a1")
							
							cs_set_user_bpammo(i, CSW_AK47, 200)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
						}
						
						case 2:
						{
							if(is_user_alive(i))
							{
								set_user_health(i, 1500)
								can_have_gun = false
							}
						}
					}
				}
				
				client_cmd(0, "mp3 play ^"%s^"", zombiesound)
				
				#if defined USE_CC
				ColorChat(0, RED, "%s Astazi este^x03 Zombie Day", PREFIX)
				#else
				client_print(0, print_chat, "%s Astazi este Zombie day", PREFIX)
				#endif				
			}
			
			case DAY_LAVA:
			{
				#if defined USE_CC
				ColorChat(0, RED, "%s Astazi este^x03 Lava Day,^x03 Stati pe^x03 tatuaje tot timpul ", PREFIX)
				#else
				client_print(0, print_chat, "%s Today is Lava day, Stand on a spray at all times", PREFIX)
				#endif
			}
			
			case DAY_SHARK:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{
					switch(cs_get_user_team(i))
					{
						case 1:
						{
							
							give_item(i, "weapon_ak47")
							give_item(i, "weapon_m4a1")
							
							cs_set_user_bpammo(i, CSW_AK47, 200)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
						}
						
						case 2:
						{
							if(is_user_alive(i))
							{
								set_user_noclip(i, 1)
								set_user_health(i, 300)
							}
						}
					}
					
					#if defined USE_CC
					ColorChat(0, RED, "%s Astazi este^x03 Shark Day", PREFIX)
					#else	
					client_print(0, print_chat, "%s Astazi e SharkDay", PREFIX)
					#endif
				}
			}
			
			case DAY_CAGE:
			{
				#if defined USE_CC
				ColorChat(0, RED, "%s Today is cage day", PREFIX)
				#else
				client_print(0, print_chat, "%s Astazi este CageDay", PREFIX)
				#endif
			}
			
			case DAY_DM:
			{
				server_cmd("mp_friendlyfire 1")
				
				#if defined USE_CC
				ColorChat(0, RED, "%s Astazi este^x03 Deathmatch Day,^x04 Ultimul prizonier sa dea /lr", PREFIX)
				#else
				client_print(0, print_chat, "%s Astazi este Deathmatch Day, Ultimul prizonier sa dea LR", PREFIX)
				#endif
			}
			
			case DAY_NIGHT:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{	
					switch(cs_get_user_team(i))
					{
						case 1:	
						{
							give_item(i, "weapon_m4a1")
							give_item(i, "weapon_deagle")
							
							cs_set_user_bpammo(i, CSW_M4A1, 200)
							cs_set_user_bpammo(i, CSW_DEAGLE, 100)
						}
						
						case 2:
						{
							strip_weapons(i)
							
							set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
							can_have_gun = false
						}
					}
				}
				
				#if defined USE_CC
				ColorChat(0, RED, "%s Astazi este a^x03 NightCrawler Day", PREFIX)
				#else
				client_print(0, print_chat, "%s Astazi este NightCrawler Day", PREFIX)
				#endif
			}
			
			case DAY_SPARTAN:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{
					switch(cs_get_user_team(i))
					{
						case CS_TEAM_T:
						{
							give_item(i, "weapon_shield")
							give_item(i, "weapon_deagle")
							
							cs_set_user_bpammo(i, CSW_DEAGLE, 100)
						}
						
						case CS_TEAM_CT:
						{
							give_item(i, "weapon_deagle")
							give_item(i, "weapon_m4a1")
							
							cs_set_user_bpammo(i, CSW_DEAGLE, 100)
							cs_set_user_bpammo(i, CSW_M4A1, 200)
						}
					}
				}
				
				#if defined USE_CC
				ColorChat(0, RED, "%s Today is^x03 Spartan Day", PREFIX)
				#else
				client_print(0, print_chat, "%s Astazi este Spartan Day", PREFIX)
				#endif
			}
			case DAY_FOOTBALL:
			{
				if(IsPlayer(i) && is_user_alive(i))
				{
					switch(cs_get_user_team(i))
					{
						case 1:
						{
							set_user_health(id, 50);
							
						}
						
						case 2:
						{
							set_user_health(id, 5000000);
							
						}    
						
					}
				}
			}
		}
	}
}

public musicday_submenu(id, musicmenu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(musicmenu)
		return PLUGIN_HANDLED
	}
	
	new Data[7], Name[64]
	new Access, Callback
	menu_item_getinfo(musicmenu, item, Access, Data, 5, Name, 63, Callback)
	
	new key = str_to_num(Data)
	
	switch(key)
	{
		case 1:
		{
			switch(random_num(1, 3))
			{
				case 1:
				{
					client_cmd(0, "mp3 play ^"%s^"", musicday_song)
				}
				
				case 2:
				{
					client_cmd(0, "mp3 play ^"%s^"", musicday_song2)
				}
				case 3:
				{
					client_cmd(0, "mp3 play ^"%s^"", musicday_song3)
				}
			}
		}
		
		case 2:
		{
			client_cmd(0, "mp3 stop")
		}
	}
	menu_display(id, musicmenu, 0)
	return PLUGIN_CONTINUE
}
////////////////////////////////////////////////////////
//-------------SHOW THE REMAINING PLAYERS-------------//
////////////////////////////////////////////////////////
public players_hud()
{
	if(get_pcvar_num(cvar_showplayers))
	{	
		g_prisoners = 0;
		g_guards = 0;
		
		for(new i = 0; i < g_max_clients; i++)
		{
			new id = i;
			
			if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
			{
				g_guards++;
			}
			else if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
			{	
				g_prisoners++;
			}	
		}
		set_hudmessage(0, 255, 0, -1.0, 0.01)
		show_hudmessage(0,"Prizonieri: %i^nGardieni: %i", g_prisoners, g_guards)
	}
}
/*=====================================================================
LAST REQUEST MAIN MENU
=====================================================================*/

public lr_check(id)
{
	if (get_user_team(id) != 1)
	{
		return PLUGIN_HANDLED
	}
	
	if(!is_user_alive(id))
	{
		return PLUGIN_HANDLED
	}
	if(lr_started)
	{
		return PLUGIN_HANDLED
	}
	
	new ctCount, trCount
	new players[32] = 0
	new pnum
	get_players(players, pnum, "a");
	for (new i = 0; i < g_max_clients; i++)
	{
		if (!is_user_alive(i))
		{
			continue;
		}
		
		switch (cs_get_user_team(i))
		{
			case CS_TEAM_CT:
			{
				ctCount++;
			}
			
			case CS_TEAM_T:
			{
				trCount++;
			}
		}
	}
	
	if (trCount > 1)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s There are^x03 to many prisoners left.", PREFIX)
		#else
		client_print(id, print_chat, "%s There are to many prisoners left.", PREFIX)
		#endif
		
		return PLUGIN_HANDLED;
	}
	
	if (ctCount == 0)
	{
		#if defined USE_CC
		ColorChat(id, RED, "%s Nu sunt^x03 oponenti", PREFIX)
		#else
		client_print(id, print_chat, "%s There are no opponents", PREFIX)
		#endif
		
		return PLUGIN_HANDLED;
	}
	if(cs_get_user_team(id) == CS_TEAM_T)	
	{	
		lr_menu(id)
	}
	return PLUGIN_HANDLED
}

public lr_menu(id)
{
	new lrmenu = menu_create("\yLast Request:", "sub_lr_menu")
	
	menu_additem(lrmenu, "\wJocuri", "1", 0);
	menu_additem(lrmenu, "\wObtiunile Rebelilor", "2", 0);
	
	menu_setprop(lrmenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, lrmenu, 0);
	
	return PLUGIN_HANDLED;
}	

public sub_lr_menu(id, lrmenu, item)
{
	
	if (item == MENU_EXIT)
	{
		menu_destroy(lrmenu);
		return PLUGIN_HANDLED;
	}
	
	new Data[7], Name[64];
	new Access, Callback;
	menu_item_getinfo(lrmenu, item, Access, Data,5, Name, 63, Callback);
	
	new Key = str_to_num(Data);
	
	switch (Key)
	{
		case 1:
		{
			gameslrmenu(id)
		}
		case 2: 
		{
			rebelmenu(id)
		}
	}
	
	menu_destroy(lrmenu);
	
	return PLUGIN_HANDLED;
}


/*==================================================================
LR GAMES MENU
==================================================================*/

public gameslrmenu(id)
{	
{
	new gamelrmenu = menu_create("\rLR:", "sub_gameslr_menu")
	
	menu_additem(gamelrmenu, "\wDuel Cutite", "1", 0);
	menu_additem(gamelrmenu, "\wDuel Deagle", "2", 0);
	menu_additem(gamelrmenu, "\wDuel Grenazi", "3", 0);
	menu_additem(gamelrmenu, "\wDuel Scout", "4", 0);
	menu_additem(gamelrmenu, "\wCursa", "5", 0);
	menu_additem(gamelrmenu, "\wDuel Tatuaje", "6", 0);
	menu_additem(gamelrmenu, "\wAruncare Degale", "7", 0);
	menu_additem(gamelrmenu, "\wDuel ShotGun", "8", 0);
	
	menu_setprop(gamelrmenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, gamelrmenu, 0);
}
return PLUGIN_HANDLED
}

public sub_gameslr_menu(id, gamelrmenu, item)
{

if (item == MENU_EXIT)
{
	menu_destroy(gamelrmenu);
	return PLUGIN_HANDLED;
}

new Data[7], Name[64];
new Access, Callback;
menu_item_getinfo(gamelrmenu, item, Access, Data,5, Name, 63, Callback);

new Key = str_to_num(Data);

switch (Key)
{
	case 1:
		lrgame[id] = LR_KNIFE
		
		case 2: 
			lrgame[id] = LR_S4S
		
		case 3: 
			lrgame[id] = LR_NADE
		
		case 4: 
			lrgame[id] = LR_SCOUT
		
		case 5: 
			lrgame[id] = LR_RACE
		
		case 6: 
			lrgame[id] = LR_SPRAY
		
		case 7:
			lrgame[id] = LR_TOSS
		
		case 8:
			lrgame[id] = LR_SHOTWAR
		
	}
	menu_destroy(gamelrmenu)
	playermenu(id)
	
	return PLUGIN_HANDLED;
}

/*=====================PLAYERMENU===========================*/
public playermenu(id)
{
	
	new menu = menu_create("\yChoose your opponent:", "submenu");
	
	new players[32], pnum, tempid;
	new szName[32], szTempid[10];
	
	get_players(players, pnum, "a");
	for(new i; i < pnum; i++)
	{
		tempid = players
		
		if (cs_get_user_team(tempid) != CS_TEAM_CT)
		{
			continue;
		}
		
		get_user_name(tempid, szName, 31);
		num_to_str(tempid, szTempid, 9);
		menu_additem(menu, szName, szTempid, 0);
	}
	
	menu_display(id, menu);
	return PLUGIN_HANDLED;
}

public submenu(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new tempid = str_to_num(data);
	
	new mapname[33]
	get_mapname(mapname, 32)
	
	new ct_origin[3], te_origin[3]
	
	switch(lrgame[id])
	{
		case LR_KNIFE:
		{	
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife");
			
			strip_user_weapons(id);
			set_user_health(id, 100);
			give_item(id, "weapon_knife");
			
			new szName[32], szName2[32];
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			
			client_print(0, print_center, "%s vs %s^n Duel Cutite", szName, szName2);
			
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			if(get_pcvar_num(cvar_teleport) && equali(mapname,"some1s_jailbreak"))
			{
				ct_origin[0] = -759, ct_origin[1] = 1047, ct_origin[2] = 100
				te_origin[0] = -585, te_origin[1] = 867, te_origin[2] = 100
				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)
				
			}
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
		}
		
		case LR_S4S:
		{
			strip_user_weapons(tempid)
			new iWep = give_item(tempid, "weapon_deagle")
			cs_set_weapon_ammo(iWep, 0)
			cs_set_user_bpammo(tempid, CSW_DEAGLE,0)
			
			strip_user_weapons(id)
			set_user_health(id, 100)
			new iWep2 = give_item(id, "weapon_deagle")    
			cs_set_weapon_ammo(iWep2, 1) 
			cs_set_user_bpammo(id, CSW_DEAGLE, 0)
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31)
			get_user_name(tempid, szName2, 31)
			
			client_print(0, print_center, "%s vs %s^n Duel Deagle",szName, szName2)   
			
			if( is_user_alive(tempid))
				set_user_health(tempid, 100);
			
			if(get_pcvar_num(cvar_teleport) && equali(mapname, "some1s_jailbreak"))
			{
				ct_origin[0] = -1352, ct_origin[1] = 271, ct_origin[2] = 38
				te_origin[0] = -1338, te_origin[1] = -782, te_origin[2] = 38
				
				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)
			}
			
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
			client_cmd(0, "mp3 play ^"%s^"", s4ssound)
			is_lr_s4s = true
		}
		
		case LR_NADE:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife")
			give_item(tempid, "weapon_hegrenade");
			cs_set_user_bpammo(tempid,CSW_HEGRENADE,50)
			
			strip_user_weapons(id)
			set_user_health(id, 100)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_hegrenade")
			cs_set_user_bpammo(id,CSW_HEGRENADE,50)
			
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Duel Grenazi",szName, szName2) 
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			if(get_pcvar_num(cvar_teleport) && equali(mapname,"some1s_jailbreak"))
			{
				ct_origin[0] = -1756, ct_origin[1] = -2526, ct_origin[2] = 36
				te_origin[0] = -3020, te_origin[1] = -2529, te_origin[2] = 36
				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)
			}
			
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
		}
		
		case LR_SCOUT:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_scout");
			give_item(tempid, "weapon_knife")
			cs_set_user_bpammo(tempid,CSW_SCOUT,10)
			
			strip_user_weapons(id)
			set_user_health(id, 100)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_scout")
			cs_set_user_bpammo(id,CSW_SCOUT,10)
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Duel Scout",szName, szName2)    
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			
			if(get_pcvar_num(cvar_teleport) && equali(mapname,"some1s_jailbreak"))
			{
				ct_origin[0] = -2898, ct_origin[1] = -2040, ct_origin[2] = 37
				te_origin[0] = -2908, te_origin[1] = 905, te_origin[2] = 37
				set_user_origin(id,te_origin)
				set_user_origin(tempid,ct_origin)
			}
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
		}
		
		case LR_RACE:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife");
			
			strip_user_weapons(id);
			set_user_health(id, 100);
			give_item(id, "weapon_knife");
			
			new szName[32], szName2[32];
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Cursa", szName, szName2);
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
			client_cmd(0, "mp3 play ^"%s^"", race_go)
		}
		
		case LR_SPRAY:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_knife");
			
			strip_user_weapons(id);
			set_user_health(id, 100);
			give_item(id, "weapon_knife");	
			
			new szName[32], szName2[32];
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center,  "%s vs %s^n Duel Tatuaje", szName, szName2);
			
			server_cmd("decalfrequency 0")
			spray_on = true
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
			
		}
		
		case LR_TOSS:
		{
			strip_user_weapons(tempid);
			new weapon = give_item(tempid, "weapon_deagle")
			give_item(tempid, "weapon_knife")
			cs_set_weapon_ammo(weapon, 0)
			cs_set_user_bpammo(tempid,CSW_DEAGLE, 0)
			
			strip_user_weapons(id);
			new weapon2 = give_item(id, "weapon_deagle")
			give_item(id, "weapon_knife")
			cs_set_weapon_ammo(weapon2, 0)
			cs_set_user_bpammo(id,CSW_DEAGLE, 0)
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Aruncare Degale",szName, szName2)    
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 100);
			
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
		}
		
		case LR_SHOTWAR:
		{
			strip_user_weapons(tempid);
			give_item(tempid, "weapon_m3");
			give_item(tempid, "weapon_knife")
			cs_set_user_bpammo(tempid,CSW_M3,100)
			
			strip_user_weapons(id)
			set_user_health(id, 255)
			give_item(id, "weapon_m3")
			give_item(id, "weapon_knife")
			cs_set_user_bpammo(id,CSW_M3,10)	
			
			new szName[32], szName2[32]
			get_user_name(id, szName, 31);
			get_user_name(tempid, szName2, 31);
			client_print(0, print_center, "%s vs %s^n Duel ShotGun",szName, szName2)    
			
			if( is_user_alive(tempid) )
				set_user_health(tempid, 255);
			
			set_task(0.1, "beacon", id)
			set_task(0.1, "beacon", tempid)
		}
		
	}
	menu_destroy(menu)
	lr_started = true
	return PLUGIN_HANDLED
}
/*================================================================
LR REBELMENU
================================================================*/
public rebelmenu(id)
{	
{
	new rebelingmenu = menu_create("\yRebel Options:", "sub_rebelmenu")
	
	menu_additem(rebelingmenu, "\wRambo", "1", 0);
	menu_additem(rebelingmenu, "\wDeagle Dude", "2", 0);
	menu_additem(rebelingmenu, "\wCrazy guy", "3", 0);
	menu_additem(rebelingmenu, "\wUber Glocker", "4", 0);
	
	menu_setprop(rebelingmenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, rebelingmenu, 0);
}

return PLUGIN_HANDLED;
}

public sub_rebelmenu(id, rebelingmenu, item)
{

if (item == MENU_EXIT)
{
	menu_destroy(rebelingmenu);
	return PLUGIN_HANDLED;
}

new Data[7], Name[64];
new Access, Callback;
menu_item_getinfo(rebelingmenu, item, Access, Data,5, Name, 63, Callback);

new Key = str_to_num(Data);

switch (Key)
{
	case 1:
	{
		strip_user_weapons(id)
		set_user_health(id, 250)
		give_item(id, "weapon_knife")
		give_item( id, "weapon_m249" );
		cs_set_user_bpammo(id,CSW_M249,300)
		
		set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
		show_hudmessage(0, "= RAMBO IS HERE =")
		lr_started = true
	}
	
	case 2: 
	{
		strip_user_weapons(id)
		set_user_health(id, 500)
		give_item(id, "weapon_knife")
		give_item( id, "weapon_deagle")
		cs_set_user_bpammo(id,CSW_DEAGLE,35)
		
		set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
		show_hudmessage(0, "= DEAGLE DUDE IS HERE =")
		lr_started = true
	}
	
	case 3: 
	{	
		strip_user_weapons(id)
		set_user_health(id, 1)
		give_item( id, "weapon_ak47")
		give_item(id, "weapon_knife")
		cs_set_user_bpammo(id,CSW_AK47,200)
		set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15)
		
		set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
		show_hudmessage(0, "= CRAZY GUY IS HERE =")
		lr_started = true
	}
	
	case 4: 
	{
		strip_user_weapons(id)
		set_user_health(id, 500)
		give_item( id, "weapon_glock18")
		give_item(id, "weapon_knife")
		cs_set_user_bpammo(id,CSW_GLOCK18,200)
		set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderTransAlpha, 255)
		
		set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.0, 0, 6.0, 12.0)
		show_hudmessage(0, "= UBER GLOCKER IS HERE =")
		lr_started = true
	}
}

menu_destroy(rebelingmenu);
lrgame[id] = LR_REBEL
return PLUGIN_HANDLED;
}

/*========================SHOT 4 SHOT BULLET==========================*/
public fw_primary_attack(ent)
{
if(!is_lr_s4s)
	return HAM_IGNORED
	
	//Get owner of entity
	
	new id = pev(ent,pev_owner)
	
	//if he's not alive
	if(!is_user_alive(id))
	{
		return HAM_IGNORED
	}
	
	//If player is in lr and can shoot deagle
	if(lr_started)
	{
		//Search enemy
		new players[32], pnum, tempid
		get_players(players, pnum, "a")
		for(new i; i < pnum; i++)
		{
			tempid = players
			//if he's in lr and can't shoot deagle and is alive
			
			if(is_user_alive(tempid) && (id !=tempid))
			{
				gun_switch(id, tempid)
			}
		}
		return HAM_HANDLED
	}
	return HAM_IGNORED
}  

public gun_switch(id, tempid)
{
	if(!is_lr_s4s || !is_user_alive(id))
	{
		return PLUGIN_HANDLED
	}
	
	if(lr_started)
	{
		
		if(is_user_alive(tempid) && (id !=tempid) && !shot_deagle[id])
		{
			strip_user_weapons(tempid)
			new deagle = give_item(tempid, "weapon_deagle")
			cs_set_weapon_ammo(deagle, 1)
			cs_set_user_bpammo(tempid, CSW_DEAGLE, 0)
			
			shot_deagle[id] = true
			shot_deagle[tempid] = false
		}
	}
	return PLUGIN_HANDLED
}  

///////////////////////////////////////////////
//----------BEACON---------------------------//
///////////////////////////////////////////////

public beacon(id)
{
	if(/*!is_user_connected(id) || */!is_user_alive(id))
		return PLUGIN_HANDLED
	
	if(cs_get_user_team(id) == CS_TEAM_CT)
	{
		static origin[3]
		get_user_origin(id, origin)
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_BEAMCYLINDER)    // TE id
		write_coord(origin[0])         // x
		write_coord(origin[1])        // y
		write_coord(origin[2]-20)    // z
		write_coord(origin[0])        // x axis
		write_coord(origin[1])        // y axis
		write_coord(origin[2]+200)    // z axis
		write_short(beacon_sprite)    // sprite
		write_byte(0)            // startframe   
		write_byte(1)            // framerate   
		write_byte(6)            // life
		write_byte(2)              // width
		write_byte(1)               // noise    
		write_byte(0)              // red  
		write_byte(0)               // green 
		write_byte(250)         // blue
		write_byte(200)            // brightness
		write_byte(0)            // speed
		message_end()
	}
	
	else if(cs_get_user_team(id) == CS_TEAM_T)
	{
		static origin[3]
		get_user_origin(id, origin)
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
		write_byte(TE_BEAMCYLINDER)    // TE id
		write_coord(origin[0])         // x
		write_coord(origin[1])        // y
		write_coord(origin[2]-20)    // z
		write_coord(origin[0])        // x axis
		write_coord(origin[1])        // y axis
		write_coord(origin[2]+200)    // z axis
		write_short(beacon_sprite)    // sprite
		write_byte(0)            // startframe   
		write_byte(1)            // framerate   
		write_byte(6)            // life
		write_byte(2)              // width
		write_byte(1)               // noise    
		write_byte(250)            // red  
		write_byte(0)               // green 
		write_byte(0)             // blue
		write_byte(200)            // brightness
		write_byte(0)            // speed
		message_end()
	}
	set_task(1.0, "beacon", id)
	
	return PLUGIN_HANDLED
}

///////////////////////////////////////////////
//----------T GAG BY Exolent[jNr]------------//
///////////////////////////////////////////////
public FwdSetVoice(receiver, sender, bool:listen)
{
	if(!get_pcvar_num(cvar_tvoiceblock))
		return PLUGIN_HANDLED
	
	if( !(1 <= receiver <= g_max_clients)
	|| !g_connected[receiver]
	|| !(1 <= sender <= g_max_clients)
	|| !g_connected[sender] ) return FMRES_IGNORED;
	
	new CsTeams:team = cs_get_user_team(sender);
	if( (team == CS_TEAM_T || team == CS_TEAM_CT && !is_user_alive(sender)) && !access(sender, ADMIN_VOICE) )
	{
		engfunc(EngFunc_SetClientListening, receiver, sender, 0);
		return FMRES_SUPERCEDE;
	}
	
	return FMRES_IGNORED;
}  

//////////////////////////////////////////////
//------------WEAPON BLOCKER----------------//
//////////////////////////////////////////////
public Event_CurWeapon(id) 
{     
	new weaponID = read_data(2) 
	
	if(can_have_gun[id])
		return PLUGIN_CONTINUE
	
	if(weaponID != CSW_KNIFE)
		client_cmd(id, "weapon_knife")
	
	return PLUGIN_CONTINUE
}
PigoExtreamCS
Membru, skill 0
Membru, skill 0
Posts: 52
Joined: 18 Dec 2013, 21:24
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 7 times
Been thanked: 1 time
Contact:

29 Dec 2013, 23:12

Sunt buguri la dayuri si la mesajele care ar trebui sa apara nu merg dayurile si nu apar mesajele.
Gardianul %s la omorat pe %s, nu apare
Astazi e Cage Day, nu apare si nu merge la toate poti rezolva?
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests