Modificare sursa

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
User avatar
tre3fla
Membru eXtream
Membru eXtream
Posts: 5333
Joined: 27 May 2012, 10:15
Detinator Steam: Da
CS Status: Allah Akbar !
Detinator server CS: Nu
SteamID: /id/tre3fla_xxx
Has thanked: 14 times
Been thanked: 129 times

11 Jul 2012, 11:33

vreau sa-mi modificati si mie sursa asta :
[DeathRun | Afiseaza codul
Duel (CT Choose ONLY)

	Plugin by ariki [I.G.]

	Idea & Pay (xD):
	DarkNill	|	ICQ: 555-995-004	(dr.ilogicgroup.org)


	Shidla [I.G.] | 2012 | 

	1.4 [Final Version] | 26/03/2012

	http://www.ilogicgroup.org/
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

#define OFFSET_RELOAD	54
#define LINUX_DIFF		4
#define ADVERTISING_TIME 30.0

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))


/*========================================================================================================
===========================================[ Customizations ]=============================================
========================================================================================================*/

new const BOT_NAME[] = "DRM Fake Player"	// InGame Bot Name (in DeathrunManager!)

new const g_ChatPrefix[] = "[Duel]"

new const CT_Aura[] = { 0, 0, 250 }
new const T_Aura[] = { 250, 0, 0 }

new const s_StartDuel[][] = { "vox/bizwarn.wav" }			// Duel starting sounds

/*========================================================================================================
=========================================[ Customizations End ]===========================================
========================================================================================================*/


new SayText, g_Maxplayers, g_Num_CT, g_MsgCurWeapon, g_DuelStarted, g_Weapon[33], g_WeaponClip[33],
	g_OneShot, g_ScoutBPAmmo, g_DeagleBPAmmo, g_AWPBPAmmo, g_M3BPAmmo, g_XM1014BPAmmo, g_M4A1BPAmmo, g_AK47BPAmmo, g_FAMASBPAmmo, g_SG552BPAmmo, g_AUGBPAmmo, g_HEGRENADEBPAmmo, g_Round_Ended, g_New_Round, RingSprite,
	CT_Player, T_Player, g_PlayerHP, g_DuelTimeOut, g_MsgSync, CountDown_Timer, g_ButtonsDisable

new const TASK_CONT = 1352	// CountDown task

stock const messages[][] = {
   
   "^x01 [^x03 I.G.^x01 ]^x04 Inscrierei pentru^x03 meciuri/mixuri^x04 de Counter-Strike pe forum ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Daca aveti probleme sau nelamuriri vizitati site-ul ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Respectati jucatorii daca vreti respect",
   "^x01 [^x03 I.G.^x01 ]^x04 Versiune de Counter-Strike (cu protocol 48 ca pe Steam) ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Discutii in legatura cu serverul si nu numai ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Inscrierei pentru meciuri/mixuri de Counter-Strike pe forum ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a vedea o lista cu^x03 serverele^x04 comunitati, scrieti in say^x03 /server",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru cereri Admine, vizitati^x03 -> http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a va schimba cutitu scrieti in say^x03 cutit^x04 sau^x03 /knife",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a fii urmarit de o^x03 culoare,^x04 scrie in say^x03 trail numar culoare.^x04 Ex:^x03 trail 12 green",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a incepe votarea unei noi harti, scrieti^x03 rtv^x04 sau^x03 rock the vote",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a lasa jocul^x03 FreeRun,^x04 tastati in say^x03 free^x04 sau^x03 freerun",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a ascult radio, tastati in say^x03 /radio^x01 |^x04 pentru al oprii tastati^x03 /stop",
   "^x01 [^x03 I.G.^x01 ]^x04 Daca nu tastati^x03 free,^x04 nu va fii luat in^x03 considerare!^x04 (cand lasati jocul freerun)",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a^x03 nomina^x04 o harta, scrieti in say^x03 numele_harti^x04. Ex:^x03 deathrun_arctic"
}

public plugin_init()
{
	
	set_task(ADVERTISING_TIME, "show_messages", _, _, _,"b");
	register_plugin("DeathRun Duel (CT Choose ONLY)", "1.4", "Vicious Vixen")
	register_cvar("Vicious Vixen", "DeathRun Duel 1.4 (CT Choose ONLY)", FCVAR_SERVER|FCVAR_SPONLY)

	register_clcmd("say /duel", "StartDuel")
	register_clcmd("say_team /duel", "StartDuel")
	register_clcmd("drop", "Drop_Cmd")

	g_ScoutBPAmmo	= register_cvar("dr_duel_scout_bpammo",		"200")
	g_DeagleBPAmmo	= register_cvar("dr_duel_deagle_bpammo",	"50")
	g_AWPBPAmmo		= register_cvar("dr_duel_awp_bpammo",		"200")
	g_M3BPAmmo		= register_cvar("dr_duel_m3_bpammo",		"200")
	g_XM1014BPAmmo		= register_cvar("dr_duel_xm1014_bpammo",	"200")
	g_M4A1BPAmmo		= register_cvar("dr_duel_m4a1_bpammo",		"200")
	g_AK47BPAmmo		= register_cvar("dr_duel_ak47_bpammo",		"200")
	g_FAMASBPAmmo		= register_cvar("dr_duel_famas_bpammo",		"200")
	g_SG552BPAmmo		= register_cvar("dr_duel_sg552_bpammo",		"200")
	g_AUGBPAmmo		= register_cvar("dr_duel_aug_bpammo",		"200")
	g_HEGRENADEBPAmmo		= register_cvar("dr_duel_hegrenade_bpammo",	"200")
	g_PlayerHP		= register_cvar("dr_duel_player_hp",		"175")
	g_DuelTimeOut	= register_cvar("dr_duel_timeout",			"3")
	g_OneShot		= register_cvar("dr_duel_one_shot", 		"1")	// 1 - one clip bullet (ONLY!); 0 - disable
	g_ButtonsDisable = register_cvar("dr_duel_buttons_disable",	"1")

	register_event("DeathMsg", "Event_Death", "a")
	register_event("HLTV", "Event_Round_Start", "a", "1=0", "2=0" )
	register_event("SendAudio", "Event_Round_End", "a", "2&%!MRAD_terwin")
	register_event("SendAudio", "Event_Round_End", "a", "2&%!MRAD_ctwin")
	register_event("SendAudio", "Event_Round_End", "a", "2&%!MRAD_rounddraw")
	register_event("CurWeapon","Event_CurWeapon","b")

	register_forward(FM_CmdStart, "fw_CmdStart",1)

	RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon")
	RegisterHam(Ham_Touch, "weapon_shield", "fw_TouchWeapon")
	RegisterHam(Ham_Touch, "armoury_entity", "fw_TouchWeapon")
	RegisterHam(Ham_Weapon_Reload, "weapon_scout", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_deagle", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_awp", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_m3", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_xm1014", "fw_Reload_Post", 2)
	RegisterHam(Ham_Weapon_Reload, "weapon_m4a1", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_ak47", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_famas", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_sg552", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_aug", "fw_Reload_Post", 3)
	RegisterHam(Ham_Use, "func_button", "fw_Use")

	SayText = get_user_msgid("SayText")
	g_MsgCurWeapon = get_user_msgid("CurWeapon")
	g_MsgSync = CreateHudSyncObj()
	g_Maxplayers = get_maxplayers()

	register_dictionary("dr_duel.txt")
}

public plugin_precache()
{
	RingSprite = precache_model("sprites/zbeam5.spr")

	static i
	for(i = 0; i < sizeof s_StartDuel; i++)
		precache_sound(s_StartDuel)
}


public client_putinserver(id)
{
	g_Weapon[id] = 0
	g_WeaponClip[id] = 0
}

public StartDuel(id)
{
	if(!is_user_alive(id))
	{
		new t_Cant_Dead[600 char]
		formatex(t_Cant_Dead, charsmax(t_Cant_Dead), "%L", id, "DR_CANT_DEAD")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Dead)
		return PLUGIN_CONTINUE
	}

	if(g_Round_Ended)
	{
		new t_Cant_Round_End[600 char]
		formatex(t_Cant_Round_End, charsmax(t_Cant_Round_End), "%L", id, "DR_CANT_ROUND_END")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Round_End)
		return PLUGIN_CONTINUE
	}

	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		new t_Cant_Ter[600 char]
		formatex(t_Cant_Ter, charsmax(t_Cant_Ter), "%L", id, "DR_CANT_TER")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Ter)
		return PLUGIN_CONTINUE
	}

	if(g_DuelStarted)
	{
		new t_Cant_Started[600 char]
		formatex(t_Cant_Started, charsmax(t_Cant_Started), "%L", id, "DR_CANT_STARTED")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Started)
		return PLUGIN_CONTINUE
	}

	for(new i = 1; i <= g_Maxplayers; i++)
	{
		new Name[32]
		get_user_name(i, Name, 31)

		if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
		{
			g_Num_CT++
			if(g_Num_CT == 1)
				CT_Player = i
			else
				CT_Player = 0
		}

		if(is_user_alive(i) && (cs_get_user_team(i) == CS_TEAM_T) && !equal(Name, BOT_NAME))
			T_Player = i
	}

	if(g_Num_CT == 1)
	{
		new TextTitle[ 200 char ]
		formatex(TextTitle, charsmax(TextTitle), "Alegeti arma:")
		new WeapScout[ 200 char ]
		formatex(WeapScout, charsmax(WeapScout), "[Scout]")
		new WeapDeagle[ 200 char ]
		formatex(WeapDeagle, charsmax(WeapDeagle), "[Deagle]")
		new WeapAWP[ 200 char ]
		formatex(WeapAWP, charsmax(WeapAWP), "[AWP]")
		new WeapM3[ 200 char ]
		formatex(WeapM3, charsmax(WeapM3), "[ShotGun]")
		new WeapXM1014[ 200 char ]
		formatex(WeapXM1014, charsmax(WeapXM1014), "[ShutGun-Automat]")
		new WeapM4A1[ 200 char ]
		formatex(WeapM4A1, charsmax(WeapM4A1), "[M4A1]")
		new WeapAK47[ 200 char ]
		formatex(WeapAK47, charsmax(WeapAK47), "[AK47]")
		new WeapFAMAS[ 200 char ]
		formatex(WeapFAMAS, charsmax(WeapFAMAS), "[Famas]")
		new WeapSG552[ 200 char ]
		formatex(WeapSG552, charsmax(WeapSG552), "[SG552]")
		new WeapAUG[ 200 char ]
		formatex(WeapAUG, charsmax(WeapAUG), "[AUG]")
		new WeapHEGRENADE[ 200 char ]
		formatex(WeapHEGRENADE, charsmax(WeapHEGRENADE), "[HE]")
		new WeapKNife[ 200 char ]
		formatex(WeapKNife, charsmax(WeapKNife), "[KnIfe]")

		new i_Menu = menu_create(TextTitle, "WeaponMenu")
		menu_additem(i_Menu, WeapScout, "1", 0)
		menu_additem(i_Menu, WeapDeagle, "2", 0)
		menu_additem(i_Menu, WeapAWP, "3", 0)
		menu_additem(i_Menu, WeapM3, "4", 0)
		menu_additem(i_Menu, WeapXM1014, "5", 0)
		menu_additem(i_Menu, WeapM4A1, "6", 0)
		menu_additem(i_Menu, WeapAK47, "7", 0)
		menu_additem(i_Menu, WeapFAMAS, "8", 0)
		menu_additem(i_Menu, WeapSG552, "9", 0)
		menu_additem(i_Menu, WeapSG552, "10", 0)
		menu_additem(i_Menu, WeapHEGRENADE, "11", 0)
		menu_additem(i_Menu, WeapKNife, "12", 0)

		g_DuelStarted = true
		g_New_Round = false

		fm_strip_user_weapons(CT_Player)
		fm_strip_user_weapons(T_Player)

		set_pev(CT_Player, pev_health, float(get_pcvar_num(g_PlayerHP)))	// Set CT HP
		set_pev(T_Player, pev_health, float(get_pcvar_num(g_PlayerHP)))		// Set T HP

		if(is_user_alive(CT_Player) && is_user_connected(CT_Player))
		{
			fm_set_user_godmode(CT_Player, 1)
			set_task(0.5, "Show_Ring", CT_Player)
		}

		if(is_user_alive(T_Player) && is_user_connected(T_Player))
		{
			fm_set_user_godmode(T_Player, 1)
			set_task(0.5, "Show_Ring", T_Player)
		}

		menu_display(CT_Player, i_Menu, 0)
	}
	else
	{
		new t_Cant_Too_Many[600 char]
		formatex(t_Cant_Too_Many, charsmax(t_Cant_Too_Many), "%L", id, "DR_CANT_TOO_MANY", g_Num_CT)
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Too_Many)
	}

	g_Num_CT = 0

	return PLUGIN_CONTINUE
}

public WeaponMenu(id, menu, item)
{
	new s_Data[4], s_Name[64], i_Access, i_Callback

	menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
	new i_Key = str_to_num(s_Data)

	switch(i_Key)
	{
		case 1:
		{
			Give_Scout(CT_Player)
			Give_Scout(T_Player)
		}

		case 2:
		{
			Give_Deagle(CT_Player)
			Give_Deagle(T_Player)
		}

		case 3:
		{
			Give_AWP(CT_Player)
			Give_AWP(T_Player)
		}
		
		case 4:
		{
			Give_M3(CT_Player)
			Give_M3(T_Player)
		}

		case 5:
		{
			Give_XM1014(CT_Player)
			Give_XM1014(T_Player)
		}
		
		case 6:
		{
			Give_M4A1(CT_Player)
			Give_M4A1(T_Player)
		}
		
		case 7:
		{
			Give_AK47(CT_Player)
			Give_AK47(T_Player)
		}
		
		case 8:
		{
			Give_FAMAS(CT_Player)
			Give_FAMAS(T_Player)
		}
		
		case 9:
		{
			Give_SG552(CT_Player)
			Give_SG552(T_Player)
		}
		
		case 10:
		{
			Give_AUG(CT_Player)
			Give_AUG(T_Player)
		}
		
		case 11:
		{
			Give_HEGRENADE(CT_Player)
			Give_HEGRENADE(T_Player)
		}
		
		case 12:
		{
			fm_give_item(CT_Player, "weapon_knife")
			fm_give_item(T_Player, "weapon_knife")
		}
	}

	menu_destroy(menu)

	if(is_user_alive(CT_Player) && is_user_connected(CT_Player))
		fm_set_rendering(CT_Player, kRenderFxGlowShell, CT_Aura[0], CT_Aura[1], CT_Aura[2], kRenderNormal, 20)

	if(is_user_alive(T_Player) && is_user_connected(T_Player))
		fm_set_rendering(T_Player, kRenderFxGlowShell, T_Aura[0], T_Aura[1], T_Aura[2], kRenderNormal, 20)

	CountDown_Timer = get_pcvar_num(g_DuelTimeOut)
	set_task(float(get_pcvar_num(g_DuelTimeOut)), "Duel_Informer", TASK_CONT)

	return PLUGIN_HANDLED
}

public Event_Death()
{
	new CT_Count, CT_Last_Player

	for(new i = 1; i <= g_Maxplayers; i++)
	{
		new Name[32]
		get_user_name(i, Name, 31)

		if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
		{
			CT_Count++
			if(CT_Count == 1)
				CT_Last_Player = i
			else
				CT_Last_Player = 0
		}
	}

	if(CT_Count == 1 && !g_Round_Ended && is_user_alive(CT_Last_Player) && is_user_connected(CT_Last_Player) && is_user_alive(T_Player))
	{
		new t_Can_Start[600 char]
		formatex(t_Can_Start, charsmax(t_Can_Start), "%L", CT_Last_Player, "DR_CAN_START")
		print_col_chat(CT_Last_Player, "^4%s^1 %s",g_ChatPrefix, t_Can_Start)
	}

	CT_Count = 0
}

public Event_Round_Start()
{
	g_DuelStarted = false
	g_Round_Ended = false
	g_New_Round = true

	g_Num_CT = 0
	CT_Player = 0
	T_Player = 0

	remove_task(TASK_CONT)

	for(new id = 1; id <= g_Maxplayers; id++)
		fm_set_rendering(id)
}

public Event_Round_End()
{
	g_Round_Ended = true

	CT_Player = 0
	T_Player = 0
}

public Event_CurWeapon(id)
{
	g_Weapon[id] = read_data(2)
	g_WeaponClip[id] = read_data(3)

	if(g_DuelStarted)
	{
		if(g_WeaponClip[id] > 1)
		{
			if(g_Weapon[id] == CSW_SCOUT)
				Weapon_ReChek(id, CSW_SCOUT)

			else if(g_Weapon[id] == CSW_DEAGLE)
				Weapon_ReChek(id, CSW_DEAGLE)

			else if(g_Weapon[id] == CSW_AWP)
				Weapon_ReChek(id, CSW_AWP)
			else if(g_Weapon[id] == CSW_M3)
				Weapon_ReChek(id, CSW_M3)
			else if(g_Weapon[id] == CSW_XM1014)
				Weapon_ReChek(id, CSW_XM1014)
			else if(g_Weapon[id] == CSW_M4A1)
				Weapon_ReChek(id, CSW_M4A1)
			else if(g_Weapon[id] == CSW_AK47)
				Weapon_ReChek(id, CSW_AK47)
			else if(g_Weapon[id] == CSW_FAMAS)
				Weapon_ReChek(id, CSW_FAMAS)
			else if(g_Weapon[id] == CSW_SG552)
				Weapon_ReChek(id, CSW_SG552)
			else if(g_Weapon[id] == CSW_AUG)
				Weapon_ReChek(id, CSW_AUG)
			else if(g_Weapon[id] == CSW_HEGRENADE)
				Weapon_ReChek(id, CSW_HEGRENADE)
		}
	}
}

public fw_CmdStart(id, handle, seed)
{
	if(!is_user_alive(id) || !g_DuelStarted)
		return FMRES_IGNORED

	if((g_Weapon[id] == CSW_SCOUT || g_Weapon[id] == CSW_DEAGLE || g_Weapon[id] == CSW_AWP || g_Weapon[id] == CSW_M3 || g_Weapon[id] == CSW_XM1014 || g_Weapon[id] == CSW_M4A1 || g_Weapon[id] == CSW_AK47 || g_Weapon[id] == CSW_FAMAS || g_Weapon[id] == CSW_SG552 || g_Weapon[id] == CSW_AUG ||  g_Weapon[id] == CSW_HEGRENADE ) && get_pcvar_num(g_OneShot))
	{
		//if(pev(id, pev_button) & IN_RELOAD)
		if(get_uc(handle, UC_Buttons) & IN_RELOAD)
		{
			set_uc(handle, UC_Buttons, get_uc(handle, UC_Buttons) & ~IN_RELOAD)
			return FMRES_HANDLED
		}
	}

	return FMRES_IGNORED
}

public Drop_Cmd(id)
{
	if(g_DuelStarted)
	{
		new t_Cant_Drop[600 char]
		formatex(t_Cant_Drop, charsmax(t_Cant_Drop), "%L", id, "DR_CANT_DROP")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Drop)
		return PLUGIN_HANDLED
	}

	return PLUGIN_CONTINUE
}

public fw_TouchWeapon(weapon, id)
{
	if(!is_user_connected(id))
		return HAM_IGNORED

	if(g_DuelStarted)
		return HAM_SUPERCEDE

	return HAM_IGNORED
}

public fw_Reload_Post(Weap)
{
	if(!g_DuelStarted && !get_pcvar_num(g_OneShot))
		return FMRES_IGNORED

	if(is_user_alive(CT_Player) && get_pdata_int(Weap, OFFSET_RELOAD, LINUX_DIFF))
	{
		if(g_Weapon[CT_Player] == CSW_SCOUT)
			cs_set_user_bpammo(CT_Player, CSW_SCOUT, cs_get_user_bpammo(CT_Player, CSW_SCOUT) + 9)
		else if(g_Weapon[CT_Player] == CSW_DEAGLE)
			cs_set_user_bpammo(CT_Player, CSW_DEAGLE, cs_get_user_bpammo(CT_Player, CSW_DEAGLE) + 6)
		else if(g_Weapon[CT_Player] == CSW_AWP)
			cs_set_user_bpammo(CT_Player, CSW_AWP, cs_get_user_bpammo(CT_Player, CSW_AWP) + 9)
		else if(g_Weapon[CT_Player] == CSW_M3)
			cs_set_user_bpammo(CT_Player, CSW_M3, cs_get_user_bpammo(CT_Player, CSW_M3)  + 7)
		else if(g_Weapon[CT_Player] == CSW_XM1014)
			cs_set_user_bpammo(CT_Player, CSW_XM1014, cs_get_user_bpammo(CT_Player, CSW_XM1014)  + 6)
		else if(g_Weapon[CT_Player] == CSW_M4A1)
			cs_set_user_bpammo(CT_Player, CSW_M4A1, cs_get_user_bpammo(CT_Player, CSW_M4A1)  + 27)
		else if(g_Weapon[CT_Player] == CSW_AK47)
			cs_set_user_bpammo(CT_Player, CSW_AK47, cs_get_user_bpammo(CT_Player, CSW_AK47)  + 27)
		else if(g_Weapon[CT_Player] == CSW_FAMAS)
			cs_set_user_bpammo(CT_Player, CSW_FAMAS, cs_get_user_bpammo(CT_Player, CSW_FAMAS)  + 22)
		else if(g_Weapon[CT_Player] == CSW_SG552)
			cs_set_user_bpammo(CT_Player, CSW_SG552, cs_get_user_bpammo(CT_Player, CSW_SG552)  + 27)
		else if(g_Weapon[CT_Player] == CSW_AUG)
			cs_set_user_bpammo(CT_Player, CSW_AUG, cs_get_user_bpammo(CT_Player, CSW_AUG)  + 27)
		else if(g_Weapon[CT_Player] == CSW_HEGRENADE)
			cs_set_user_bpammo(CT_Player, CSW_HEGRENADE, cs_get_user_bpammo(CT_Player, CSW_HEGRENADE)  + 1)
	}

	if(is_user_alive(T_Player) && get_pdata_int(Weap, OFFSET_RELOAD, LINUX_DIFF))
	{
		if(g_Weapon[T_Player] == CSW_SCOUT)
			cs_set_user_bpammo(T_Player, CSW_SCOUT, cs_get_user_bpammo(T_Player, CSW_SCOUT) + 9)
		else if(g_Weapon[T_Player] == CSW_DEAGLE)
			cs_set_user_bpammo(T_Player, CSW_DEAGLE, cs_get_user_bpammo(T_Player, CSW_DEAGLE) + 6)
		else if(g_Weapon[T_Player] == CSW_AWP)
			cs_set_user_bpammo(T_Player, CSW_AWP, cs_get_user_bpammo(T_Player, CSW_AWP) + 9)
		else if(g_Weapon[T_Player] == CSW_M3)
			cs_set_user_bpammo(T_Player, CSW_M3, cs_get_user_bpammo(T_Player, CSW_M3) + 7)
		else if(g_Weapon[T_Player] == CSW_XM1014)
			cs_set_user_bpammo(T_Player, CSW_XM1014, cs_get_user_bpammo(T_Player, CSW_XM1014) + 6)
		else if(g_Weapon[T_Player] == CSW_M4A1)
			cs_set_user_bpammo(T_Player, CSW_M4A1, cs_get_user_bpammo(T_Player, CSW_M4A1) + 27)
		else if(g_Weapon[T_Player] == CSW_AK47)
			cs_set_user_bpammo(T_Player, CSW_AK47, cs_get_user_bpammo(T_Player, CSW_AK47) + 27)
		else if(g_Weapon[T_Player] == CSW_FAMAS)
			cs_set_user_bpammo(T_Player, CSW_FAMAS, cs_get_user_bpammo(T_Player, CSW_FAMAS) + 22)
		else if(g_Weapon[T_Player] == CSW_SG552)
			cs_set_user_bpammo(T_Player, CSW_SG552, cs_get_user_bpammo(T_Player, CSW_SG552) + 27)
		else if(g_Weapon[T_Player] == CSW_AUG)
			cs_set_user_bpammo(T_Player, CSW_AUG, cs_get_user_bpammo(T_Player, CSW_AUG) + 27)
		else if(g_Weapon[T_Player] == CSW_HEGRENADE)
			cs_set_user_bpammo(T_Player, CSW_HEGRENADE, cs_get_user_bpammo(T_Player, CSW_HEGRENADE) + 1)
	}

	return FMRES_IGNORED
}

public fw_Use(ent, idcaller, idactivator, use_type, Float:value)
{
	if(g_ButtonsDisable && g_DuelStarted && is_user_alive(idactivator) && cs_get_user_team(idactivator) == CS_TEAM_T)
	{
		new t_Cant_Drop[600 char]
		formatex(t_Cant_Drop, charsmax(t_Cant_Drop), "%L", idactivator, "DR_CANT_USE")
		print_col_chat(idactivator, "^4%s^1 %s",g_ChatPrefix, t_Cant_Drop)
		return HAM_SUPERCEDE
	}

	return HAM_IGNORED
}

public Duel_Informer()
{
	if(CountDown_Timer > 1)
	{
		set_hudmessage(255, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, -1)

		if(CountDown_Timer != 1)
		{
			for(new id = 1; id <= g_Maxplayers; id++)
			{
				new t_Time_Delay[600 char]
				formatex(t_Time_Delay, charsmax(t_Time_Delay), "%L", id, "DR_TIME_DELAY", CountDown_Timer - 1)
				ShowSyncHudMsg(id, g_MsgSync, "%s", t_Time_Delay)
			}
		}
	}
	--CountDown_Timer

	if(CountDown_Timer >= 1)
		set_task(1.0, "Duel_Informer", TASK_CONT)
	else
	{
		client_cmd(0, "spk %s", s_StartDuel[random_num(0, sizeof s_StartDuel - 1)])

		if(is_user_alive(CT_Player) && is_user_connected(CT_Player))
			fm_set_user_godmode(CT_Player, 0)

		if(is_user_alive(T_Player) && is_user_connected(T_Player))
			fm_set_user_godmode(T_Player, 0)

		remove_task(TASK_CONT)
	}
}

public show_messages()
{
   new Buffer[256];
   formatex(Buffer, sizeof Buffer - 1, "^x04%s", messages[random(sizeof messages)]);
   
   new players[32], num, id;
   get_players(players, num);
   
   for(new i = 0 ; i < num ; i++)
   {
      id = players
      
      message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
      write_byte(id);
      write_string(Buffer);
      message_end();
   }
}

public Show_Ring(id)
{
	if(g_DuelStarted && is_user_alive(id) && is_user_connected(id) && !g_New_Round)
	{
		static Float:origin[3]
		pev(id, pev_origin, origin)

		if(id == CT_Player)
			Ring(origin, CT_Aura[0], CT_Aura[1], CT_Aura[2])
		else if(id == T_Player)
			Ring(origin, T_Aura[0], T_Aura[1], T_Aura[2])

		set_task(0.5, "Show_Ring", id)
	}
	else
		remove_task(id)
}


/*========================================================================================================
===============================================[ Stocks ]=================================================
========================================================================================================*/
stock fm_give_item(index, const item[])
{
	if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
		return 0

	new ent = fm_create_entity(item)
	if (!pev_valid(ent))
		return 0

	new Float:origin[3]
	pev(index, pev_origin, origin)
	set_pev(ent, pev_origin, origin)
	set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
	dllfunc(DLLFunc_Spawn, ent)

	new save = pev(ent, pev_solid)
	dllfunc(DLLFunc_Touch, ent, index)
	if (pev(ent, pev_solid) != save)
		return ent

	engfunc(EngFunc_RemoveEntity, ent)

	return -1
}

stock fm_strip_user_weapons(index)
{
	new ent = fm_create_entity("player_weaponstrip")
	if (!pev_valid(ent))
		return 0

	dllfunc(DLLFunc_Spawn, ent)
	dllfunc(DLLFunc_Use, ent, index)
	engfunc(EngFunc_RemoveEntity, ent)

	return 1
}

stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
	new Float:RenderColor[3]
	RenderColor[0] = float(r)
	RenderColor[1] = float(g)
	RenderColor[2] = float(b)

	set_pev(entity, pev_renderfx, fx)
	set_pev(entity, pev_rendercolor, RenderColor)
	set_pev(entity, pev_rendermode, render)
	set_pev(entity, pev_renderamt, float(amount))

	return 1
}

stock get_weapon_ent(id,wpnid=0,wpnName[]="")
{
	// who knows what wpnName will be
	static newName[32]

	// need to find the name
	if(wpnid) get_weaponname(wpnid,newName,31)

	// go with what we were told
	else formatex(newName,31,"%s",wpnName)

	// prefix it if we need to
	if(!equal(newName,"weapon_",7))
		format(newName,31,"weapon_%s",newName)

	new ent
	while((ent = engfunc(EngFunc_FindEntityByString,ent,"classname",newName)) && pev(ent,pev_owner) != id) {}

	return ent
}

stock fm_set_user_godmode(index, godmode = 0)
{
	set_pev(index, pev_takedamage, godmode == 1 ? DAMAGE_NO : DAMAGE_AIM)

	return 1
}

stock print_col_chat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, "!g", "^4") // Green Color
	replace_all(msg, 190, "!y", "^1") // Default Color (Yellow)
	replace_all(msg, 190, "!t", "^3") // Team Color

	if (id) players[0] = id; else get_players(players, count, "ch") 
	{
		for ( new i = 0; i < count; i++ )
		{
			if ( is_user_connected(players) )
			{
				message_begin(MSG_ONE_UNRELIABLE, SayText, _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}

UpDate_HUD(id, csw_weapon)
{
	message_begin(MSG_ONE, g_MsgCurWeapon, _, id)
	write_byte(1)
	write_byte(csw_weapon)	//CSW_weapon
	write_byte(1)	// MaxClip
	message_end()
}

Give_Scout(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_scout")

		new wEnt = get_weapon_ent(id, CSW_SCOUT)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_SCOUT, get_pcvar_num(g_ScoutBPAmmo))
		UpDate_HUD(id, wEnt)
	}

}

Give_Deagle(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_deagle")

		new wEnt = get_weapon_ent(id, CSW_DEAGLE)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_DEAGLE, get_pcvar_num(g_DeagleBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_AWP(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_awp")

		new wEnt = get_weapon_ent(id, CSW_AWP)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_AWP, get_pcvar_num(g_AWPBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_M3(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_m3")

		new wEnt = get_weapon_ent(id, CSW_M3)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_M3, get_pcvar_num(g_M3BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_XM1014(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_xm1014")

		new wEnt = get_weapon_ent(id, CSW_XM1014)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_XM1014, get_pcvar_num(g_XM1014BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_M4A1(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_m4a1")

		new wEnt = get_weapon_ent(id, CSW_M4A1)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_M4A1, get_pcvar_num(g_M4A1BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_AK47(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_ak47")

		new wEnt = get_weapon_ent(id, CSW_AK47)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_AK47, get_pcvar_num(g_AK47BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_FAMAS(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_famas")

		new wEnt = get_weapon_ent(id, CSW_FAMAS)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_FAMAS, get_pcvar_num(g_FAMASBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_SG552(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_sg552")

		new wEnt = get_weapon_ent(id, CSW_SG552)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_SG552, get_pcvar_num(g_SG552BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_AUG(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_aug")

		new wEnt = get_weapon_ent(id, CSW_AUG)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_AUG, get_pcvar_num(g_AUGBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_HEGRENADE(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_hegrenade")

		new wEnt = get_weapon_ent(id, CSW_HEGRENADE)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_HEGRENADE, get_pcvar_num(g_HEGRENADEBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Weapon_ReChek(id, Weap)
{
	if(get_pcvar_num(g_OneShot) && is_user_alive(id) && is_user_connected(id))
	{
		new wEnt = get_weapon_ent(id, Weap)
		if(pev_valid(wEnt))
		{
			cs_set_weapon_ammo(wEnt, 1)
			UpDate_HUD(id, wEnt)
		}
	}
}

Ring(const Float:origin[3], R, G, B)
{
	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
	write_byte(TE_BEAMCYLINDER) // TE id
	engfunc(EngFunc_WriteCoord, origin[0]) // x	10
	engfunc(EngFunc_WriteCoord, origin[1]) // y
	engfunc(EngFunc_WriteCoord, origin[2]) // z
	engfunc(EngFunc_WriteCoord, origin[0]-50.0) // x axis
	engfunc(EngFunc_WriteCoord, origin[1]) // y axis
	engfunc(EngFunc_WriteCoord, origin[2]+100.0) // z axis
	write_short(RingSprite) // sprite
	write_byte(0) // startframe
	write_byte(0) // framerate
	write_byte(5) // life
	write_byte(5) // width
	write_byte(0) // noise
	write_byte(R) // red
	write_byte(G) // green
	write_byte(B) // blue
	write_byte(200) // brightness
	write_byte(0) // speed
	message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
]dr_duel.sma



Mai exact vreau sa-mi coateti mesajele astea
| Afiseaza codul
"^x01 [^x03 I.G.^x01 ]^x04 Inscrierei pentru^x03 meciuri/mixuri^x04 de Counter-Strike pe forum ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Daca aveti probleme sau nelamuriri vizitati site-ul ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Respectati jucatorii daca vreti respect",
   "^x01 [^x03 I.G.^x01 ]^x04 Versiune de Counter-Strike (cu protocol 48 ca pe Steam) ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Discutii in legatura cu serverul si nu numai ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Inscrierei pentru meciuri/mixuri de Counter-Strike pe forum ->^x03 http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a vedea o lista cu^x03 serverele^x04 comunitati, scrieti in say^x03 /server",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru cereri Admine, vizitati^x03 -> http://www.ilogicgroup.org",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a va schimba cutitu scrieti in say^x03 cutit^x04 sau^x03 /knife",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a fii urmarit de o^x03 culoare,^x04 scrie in say^x03 trail numar culoare.^x04 Ex:^x03 trail 12 green",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a incepe votarea unei noi harti, scrieti^x03 rtv^x04 sau^x03 rock the vote",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a lasa jocul^x03 FreeRun,^x04 tastati in say^x03 free^x04 sau^x03 freerun",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a ascult radio, tastati in say^x03 /radio^x01 |^x04 pentru al oprii tastati^x03 /stop",
   "^x01 [^x03 I.G.^x01 ]^x04 Daca nu tastati^x03 free,^x04 nu va fii luat in^x03 considerare!^x04 (cand lasati jocul freerun)",
   "^x01 [^x03 I.G.^x01 ]^x04 Pentru a^x03 nomina^x04 o harta, scrieti in say^x03 numele_harti^x04. Ex:^x03 deathrun_arctic"


Multumesc anticipat
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2054
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1131 times
Contact:

11 Jul 2012, 12:25

poftim
spoiler | Afiseaza codul
/*Duel (CT Choose ONLY)

	Plugin by ariki [I.G.]

	Idea & Pay (xD):
	DarkNill	|	ICQ: 555-995-004	(dr.ilogicgroup.org)


	Shidla [I.G.] | 2012 | 

	1.4 [Final Version] | 26/03/2012

	http://www.ilogicgroup.org/
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

#define OFFSET_RELOAD	54
#define LINUX_DIFF		4

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))


/*========================================================================================================
===========================================[ Customizations ]=============================================
========================================================================================================*/

new const BOT_NAME[] = "DRM Fake Player"	// InGame Bot Name (in DeathrunManager!)

new const g_ChatPrefix[] = "[Duel]"

new const CT_Aura[] = { 0, 0, 250 }
new const T_Aura[] = { 250, 0, 0 }

new const s_StartDuel[][] = { "vox/bizwarn.wav" }			// Duel starting sounds

/*========================================================================================================
=========================================[ Customizations End ]===========================================
========================================================================================================*/


new SayText, g_Maxplayers, g_Num_CT, g_MsgCurWeapon, g_DuelStarted, g_Weapon[33], g_WeaponClip[33],
	g_OneShot, g_ScoutBPAmmo, g_DeagleBPAmmo, g_AWPBPAmmo, g_M3BPAmmo, g_XM1014BPAmmo, g_M4A1BPAmmo, g_AK47BPAmmo, g_FAMASBPAmmo, g_SG552BPAmmo, g_AUGBPAmmo, g_HEGRENADEBPAmmo, g_Round_Ended, g_New_Round, RingSprite,
	CT_Player, T_Player, g_PlayerHP, g_DuelTimeOut, g_MsgSync, CountDown_Timer, g_ButtonsDisable

new const TASK_CONT = 1352	// CountDown task

public plugin_init()
{
	
	register_plugin("DeathRun Duel (CT Choose ONLY)", "1.4", "Vicious Vixen")
	register_cvar("Vicious Vixen", "DeathRun Duel 1.4 (CT Choose ONLY)", FCVAR_SERVER|FCVAR_SPONLY)

	register_clcmd("say /duel", "StartDuel")
	register_clcmd("say_team /duel", "StartDuel")
	register_clcmd("drop", "Drop_Cmd")

	g_ScoutBPAmmo	= register_cvar("dr_duel_scout_bpammo",		"200")
	g_DeagleBPAmmo	= register_cvar("dr_duel_deagle_bpammo",	"50")
	g_AWPBPAmmo		= register_cvar("dr_duel_awp_bpammo",		"200")
	g_M3BPAmmo		= register_cvar("dr_duel_m3_bpammo",		"200")
	g_XM1014BPAmmo		= register_cvar("dr_duel_xm1014_bpammo",	"200")
	g_M4A1BPAmmo		= register_cvar("dr_duel_m4a1_bpammo",		"200")
	g_AK47BPAmmo		= register_cvar("dr_duel_ak47_bpammo",		"200")
	g_FAMASBPAmmo		= register_cvar("dr_duel_famas_bpammo",		"200")
	g_SG552BPAmmo		= register_cvar("dr_duel_sg552_bpammo",		"200")
	g_AUGBPAmmo		= register_cvar("dr_duel_aug_bpammo",		"200")
	g_HEGRENADEBPAmmo		= register_cvar("dr_duel_hegrenade_bpammo",	"200")
	g_PlayerHP		= register_cvar("dr_duel_player_hp",		"175")
	g_DuelTimeOut	= register_cvar("dr_duel_timeout",			"3")
	g_OneShot		= register_cvar("dr_duel_one_shot", 		"1")	// 1 - one clip bullet (ONLY!); 0 - disable
	g_ButtonsDisable = register_cvar("dr_duel_buttons_disable",	"1")

	register_event("DeathMsg", "Event_Death", "a")
	register_event("HLTV", "Event_Round_Start", "a", "1=0", "2=0" )
	register_event("SendAudio", "Event_Round_End", "a", "2&%!MRAD_terwin")
	register_event("SendAudio", "Event_Round_End", "a", "2&%!MRAD_ctwin")
	register_event("SendAudio", "Event_Round_End", "a", "2&%!MRAD_rounddraw")
	register_event("CurWeapon","Event_CurWeapon","b")

	register_forward(FM_CmdStart, "fw_CmdStart",1)

	RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon")
	RegisterHam(Ham_Touch, "weapon_shield", "fw_TouchWeapon")
	RegisterHam(Ham_Touch, "armoury_entity", "fw_TouchWeapon")
	RegisterHam(Ham_Weapon_Reload, "weapon_scout", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_deagle", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_awp", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_m3", "fw_Reload_Post", 1)
	RegisterHam(Ham_Weapon_Reload, "weapon_xm1014", "fw_Reload_Post", 2)
	RegisterHam(Ham_Weapon_Reload, "weapon_m4a1", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_ak47", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_famas", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_sg552", "fw_Reload_Post", 3)
	RegisterHam(Ham_Weapon_Reload, "weapon_aug", "fw_Reload_Post", 3)
	RegisterHam(Ham_Use, "func_button", "fw_Use")

	SayText = get_user_msgid("SayText")
	g_MsgCurWeapon = get_user_msgid("CurWeapon")
	g_MsgSync = CreateHudSyncObj()
	g_Maxplayers = get_maxplayers()

	register_dictionary("dr_duel.txt")
}

public plugin_precache()
{
	RingSprite = precache_model("sprites/zbeam5.spr")

	static i
	for(i = 0; i < sizeof s_StartDuel; i++)
		precache_sound(s_StartDuel)
}


public client_putinserver(id)
{
	g_Weapon[id] = 0
	g_WeaponClip[id] = 0
}

public StartDuel(id)
{
	if(!is_user_alive(id))
	{
		new t_Cant_Dead[600 char]
		formatex(t_Cant_Dead, charsmax(t_Cant_Dead), "%L", id, "DR_CANT_DEAD")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Dead)
		return PLUGIN_CONTINUE
	}

	if(g_Round_Ended)
	{
		new t_Cant_Round_End[600 char]
		formatex(t_Cant_Round_End, charsmax(t_Cant_Round_End), "%L", id, "DR_CANT_ROUND_END")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Round_End)
		return PLUGIN_CONTINUE
	}

	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		new t_Cant_Ter[600 char]
		formatex(t_Cant_Ter, charsmax(t_Cant_Ter), "%L", id, "DR_CANT_TER")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Ter)
		return PLUGIN_CONTINUE
	}

	if(g_DuelStarted)
	{
		new t_Cant_Started[600 char]
		formatex(t_Cant_Started, charsmax(t_Cant_Started), "%L", id, "DR_CANT_STARTED")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Started)
		return PLUGIN_CONTINUE
	}

	for(new i = 1; i <= g_Maxplayers; i++)
	{
		new Name[32]
		get_user_name(i, Name, 31)

		if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
		{
			g_Num_CT++
			if(g_Num_CT == 1)
				CT_Player = i
			else
				CT_Player = 0
		}

		if(is_user_alive(i) && (cs_get_user_team(i) == CS_TEAM_T) && !equal(Name, BOT_NAME))
			T_Player = i
	}

	if(g_Num_CT == 1)
	{
		new TextTitle[ 200 char ]
		formatex(TextTitle, charsmax(TextTitle), "Alegeti arma:")
		new WeapScout[ 200 char ]
		formatex(WeapScout, charsmax(WeapScout), "[Scout]")
		new WeapDeagle[ 200 char ]
		formatex(WeapDeagle, charsmax(WeapDeagle), "[Deagle]")
		new WeapAWP[ 200 char ]
		formatex(WeapAWP, charsmax(WeapAWP), "[AWP]")
		new WeapM3[ 200 char ]
		formatex(WeapM3, charsmax(WeapM3), "[ShotGun]")
		new WeapXM1014[ 200 char ]
		formatex(WeapXM1014, charsmax(WeapXM1014), "[ShutGun-Automat]")
		new WeapM4A1[ 200 char ]
		formatex(WeapM4A1, charsmax(WeapM4A1), "[M4A1]")
		new WeapAK47[ 200 char ]
		formatex(WeapAK47, charsmax(WeapAK47), "[AK47]")
		new WeapFAMAS[ 200 char ]
		formatex(WeapFAMAS, charsmax(WeapFAMAS), "[Famas]")
		new WeapSG552[ 200 char ]
		formatex(WeapSG552, charsmax(WeapSG552), "[SG552]")
		new WeapAUG[ 200 char ]
		formatex(WeapAUG, charsmax(WeapAUG), "[AUG]")
		new WeapHEGRENADE[ 200 char ]
		formatex(WeapHEGRENADE, charsmax(WeapHEGRENADE), "[HE]")
		new WeapKNife[ 200 char ]
		formatex(WeapKNife, charsmax(WeapKNife), "[KnIfe]")

		new i_Menu = menu_create(TextTitle, "WeaponMenu")
		menu_additem(i_Menu, WeapScout, "1", 0)
		menu_additem(i_Menu, WeapDeagle, "2", 0)
		menu_additem(i_Menu, WeapAWP, "3", 0)
		menu_additem(i_Menu, WeapM3, "4", 0)
		menu_additem(i_Menu, WeapXM1014, "5", 0)
		menu_additem(i_Menu, WeapM4A1, "6", 0)
		menu_additem(i_Menu, WeapAK47, "7", 0)
		menu_additem(i_Menu, WeapFAMAS, "8", 0)
		menu_additem(i_Menu, WeapSG552, "9", 0)
		menu_additem(i_Menu, WeapSG552, "10", 0)
		menu_additem(i_Menu, WeapHEGRENADE, "11", 0)
		menu_additem(i_Menu, WeapKNife, "12", 0)

		g_DuelStarted = true
		g_New_Round = false

		fm_strip_user_weapons(CT_Player)
		fm_strip_user_weapons(T_Player)

		set_pev(CT_Player, pev_health, float(get_pcvar_num(g_PlayerHP)))	// Set CT HP
		set_pev(T_Player, pev_health, float(get_pcvar_num(g_PlayerHP)))		// Set T HP

		if(is_user_alive(CT_Player) && is_user_connected(CT_Player))
		{
			fm_set_user_godmode(CT_Player, 1)
			set_task(0.5, "Show_Ring", CT_Player)
		}

		if(is_user_alive(T_Player) && is_user_connected(T_Player))
		{
			fm_set_user_godmode(T_Player, 1)
			set_task(0.5, "Show_Ring", T_Player)
		}

		menu_display(CT_Player, i_Menu, 0)
	}
	else
	{
		new t_Cant_Too_Many[600 char]
		formatex(t_Cant_Too_Many, charsmax(t_Cant_Too_Many), "%L", id, "DR_CANT_TOO_MANY", g_Num_CT)
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Too_Many)
	}

	g_Num_CT = 0

	return PLUGIN_CONTINUE
}

public WeaponMenu(id, menu, item)
{
	new s_Data[4], s_Name[64], i_Access, i_Callback

	menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
	new i_Key = str_to_num(s_Data)

	switch(i_Key)
	{
		case 1:
		{
			Give_Scout(CT_Player)
			Give_Scout(T_Player)
		}

		case 2:
		{
			Give_Deagle(CT_Player)
			Give_Deagle(T_Player)
		}

		case 3:
		{
			Give_AWP(CT_Player)
			Give_AWP(T_Player)
		}
		
		case 4:
		{
			Give_M3(CT_Player)
			Give_M3(T_Player)
		}

		case 5:
		{
			Give_XM1014(CT_Player)
			Give_XM1014(T_Player)
		}
		
		case 6:
		{
			Give_M4A1(CT_Player)
			Give_M4A1(T_Player)
		}
		
		case 7:
		{
			Give_AK47(CT_Player)
			Give_AK47(T_Player)
		}
		
		case 8:
		{
			Give_FAMAS(CT_Player)
			Give_FAMAS(T_Player)
		}
		
		case 9:
		{
			Give_SG552(CT_Player)
			Give_SG552(T_Player)
		}
		
		case 10:
		{
			Give_AUG(CT_Player)
			Give_AUG(T_Player)
		}
		
		case 11:
		{
			Give_HEGRENADE(CT_Player)
			Give_HEGRENADE(T_Player)
		}
		
		case 12:
		{
			fm_give_item(CT_Player, "weapon_knife")
			fm_give_item(T_Player, "weapon_knife")
		}
	}

	menu_destroy(menu)

	if(is_user_alive(CT_Player) && is_user_connected(CT_Player))
		fm_set_rendering(CT_Player, kRenderFxGlowShell, CT_Aura[0], CT_Aura[1], CT_Aura[2], kRenderNormal, 20)

	if(is_user_alive(T_Player) && is_user_connected(T_Player))
		fm_set_rendering(T_Player, kRenderFxGlowShell, T_Aura[0], T_Aura[1], T_Aura[2], kRenderNormal, 20)

	CountDown_Timer = get_pcvar_num(g_DuelTimeOut)
	set_task(float(get_pcvar_num(g_DuelTimeOut)), "Duel_Informer", TASK_CONT)

	return PLUGIN_HANDLED
}

public Event_Death()
{
	new CT_Count, CT_Last_Player

	for(new i = 1; i <= g_Maxplayers; i++)
	{
		new Name[32]
		get_user_name(i, Name, 31)

		if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
		{
			CT_Count++
			if(CT_Count == 1)
				CT_Last_Player = i
			else
				CT_Last_Player = 0
		}
	}

	if(CT_Count == 1 && !g_Round_Ended && is_user_alive(CT_Last_Player) && is_user_connected(CT_Last_Player) && is_user_alive(T_Player))
	{
		new t_Can_Start[600 char]
		formatex(t_Can_Start, charsmax(t_Can_Start), "%L", CT_Last_Player, "DR_CAN_START")
		print_col_chat(CT_Last_Player, "^4%s^1 %s",g_ChatPrefix, t_Can_Start)
	}

	CT_Count = 0
}

public Event_Round_Start()
{
	g_DuelStarted = false
	g_Round_Ended = false
	g_New_Round = true

	g_Num_CT = 0
	CT_Player = 0
	T_Player = 0

	remove_task(TASK_CONT)

	for(new id = 1; id <= g_Maxplayers; id++)
		fm_set_rendering(id)
}

public Event_Round_End()
{
	g_Round_Ended = true

	CT_Player = 0
	T_Player = 0
}

public Event_CurWeapon(id)
{
	g_Weapon[id] = read_data(2)
	g_WeaponClip[id] = read_data(3)

	if(g_DuelStarted)
	{
		if(g_WeaponClip[id] > 1)
		{
			if(g_Weapon[id] == CSW_SCOUT)
				Weapon_ReChek(id, CSW_SCOUT)

			else if(g_Weapon[id] == CSW_DEAGLE)
				Weapon_ReChek(id, CSW_DEAGLE)

			else if(g_Weapon[id] == CSW_AWP)
				Weapon_ReChek(id, CSW_AWP)
			else if(g_Weapon[id] == CSW_M3)
				Weapon_ReChek(id, CSW_M3)
			else if(g_Weapon[id] == CSW_XM1014)
				Weapon_ReChek(id, CSW_XM1014)
			else if(g_Weapon[id] == CSW_M4A1)
				Weapon_ReChek(id, CSW_M4A1)
			else if(g_Weapon[id] == CSW_AK47)
				Weapon_ReChek(id, CSW_AK47)
			else if(g_Weapon[id] == CSW_FAMAS)
				Weapon_ReChek(id, CSW_FAMAS)
			else if(g_Weapon[id] == CSW_SG552)
				Weapon_ReChek(id, CSW_SG552)
			else if(g_Weapon[id] == CSW_AUG)
				Weapon_ReChek(id, CSW_AUG)
			else if(g_Weapon[id] == CSW_HEGRENADE)
				Weapon_ReChek(id, CSW_HEGRENADE)
		}
	}
}

public fw_CmdStart(id, handle, seed)
{
	if(!is_user_alive(id) || !g_DuelStarted)
		return FMRES_IGNORED

	if((g_Weapon[id] == CSW_SCOUT || g_Weapon[id] == CSW_DEAGLE || g_Weapon[id] == CSW_AWP || g_Weapon[id] == CSW_M3 || g_Weapon[id] == CSW_XM1014 || g_Weapon[id] == CSW_M4A1 || g_Weapon[id] == CSW_AK47 || g_Weapon[id] == CSW_FAMAS || g_Weapon[id] == CSW_SG552 || g_Weapon[id] == CSW_AUG ||  g_Weapon[id] == CSW_HEGRENADE ) && get_pcvar_num(g_OneShot))
	{
		//if(pev(id, pev_button) & IN_RELOAD)
		if(get_uc(handle, UC_Buttons) & IN_RELOAD)
		{
			set_uc(handle, UC_Buttons, get_uc(handle, UC_Buttons) & ~IN_RELOAD)
			return FMRES_HANDLED
		}
	}

	return FMRES_IGNORED
}

public Drop_Cmd(id)
{
	if(g_DuelStarted)
	{
		new t_Cant_Drop[600 char]
		formatex(t_Cant_Drop, charsmax(t_Cant_Drop), "%L", id, "DR_CANT_DROP")
		print_col_chat(id, "^4%s^1 %s",g_ChatPrefix, t_Cant_Drop)
		return PLUGIN_HANDLED
	}

	return PLUGIN_CONTINUE
}

public fw_TouchWeapon(weapon, id)
{
	if(!is_user_connected(id))
		return HAM_IGNORED

	if(g_DuelStarted)
		return HAM_SUPERCEDE

	return HAM_IGNORED
}

public fw_Reload_Post(Weap)
{
	if(!g_DuelStarted && !get_pcvar_num(g_OneShot))
		return FMRES_IGNORED

	if(is_user_alive(CT_Player) && get_pdata_int(Weap, OFFSET_RELOAD, LINUX_DIFF))
	{
		if(g_Weapon[CT_Player] == CSW_SCOUT)
			cs_set_user_bpammo(CT_Player, CSW_SCOUT, cs_get_user_bpammo(CT_Player, CSW_SCOUT) + 9)
		else if(g_Weapon[CT_Player] == CSW_DEAGLE)
			cs_set_user_bpammo(CT_Player, CSW_DEAGLE, cs_get_user_bpammo(CT_Player, CSW_DEAGLE) + 6)
		else if(g_Weapon[CT_Player] == CSW_AWP)
			cs_set_user_bpammo(CT_Player, CSW_AWP, cs_get_user_bpammo(CT_Player, CSW_AWP) + 9)
		else if(g_Weapon[CT_Player] == CSW_M3)
			cs_set_user_bpammo(CT_Player, CSW_M3, cs_get_user_bpammo(CT_Player, CSW_M3)  + 7)
		else if(g_Weapon[CT_Player] == CSW_XM1014)
			cs_set_user_bpammo(CT_Player, CSW_XM1014, cs_get_user_bpammo(CT_Player, CSW_XM1014)  + 6)
		else if(g_Weapon[CT_Player] == CSW_M4A1)
			cs_set_user_bpammo(CT_Player, CSW_M4A1, cs_get_user_bpammo(CT_Player, CSW_M4A1)  + 27)
		else if(g_Weapon[CT_Player] == CSW_AK47)
			cs_set_user_bpammo(CT_Player, CSW_AK47, cs_get_user_bpammo(CT_Player, CSW_AK47)  + 27)
		else if(g_Weapon[CT_Player] == CSW_FAMAS)
			cs_set_user_bpammo(CT_Player, CSW_FAMAS, cs_get_user_bpammo(CT_Player, CSW_FAMAS)  + 22)
		else if(g_Weapon[CT_Player] == CSW_SG552)
			cs_set_user_bpammo(CT_Player, CSW_SG552, cs_get_user_bpammo(CT_Player, CSW_SG552)  + 27)
		else if(g_Weapon[CT_Player] == CSW_AUG)
			cs_set_user_bpammo(CT_Player, CSW_AUG, cs_get_user_bpammo(CT_Player, CSW_AUG)  + 27)
		else if(g_Weapon[CT_Player] == CSW_HEGRENADE)
			cs_set_user_bpammo(CT_Player, CSW_HEGRENADE, cs_get_user_bpammo(CT_Player, CSW_HEGRENADE)  + 1)
	}

	if(is_user_alive(T_Player) && get_pdata_int(Weap, OFFSET_RELOAD, LINUX_DIFF))
	{
		if(g_Weapon[T_Player] == CSW_SCOUT)
			cs_set_user_bpammo(T_Player, CSW_SCOUT, cs_get_user_bpammo(T_Player, CSW_SCOUT) + 9)
		else if(g_Weapon[T_Player] == CSW_DEAGLE)
			cs_set_user_bpammo(T_Player, CSW_DEAGLE, cs_get_user_bpammo(T_Player, CSW_DEAGLE) + 6)
		else if(g_Weapon[T_Player] == CSW_AWP)
			cs_set_user_bpammo(T_Player, CSW_AWP, cs_get_user_bpammo(T_Player, CSW_AWP) + 9)
		else if(g_Weapon[T_Player] == CSW_M3)
			cs_set_user_bpammo(T_Player, CSW_M3, cs_get_user_bpammo(T_Player, CSW_M3) + 7)
		else if(g_Weapon[T_Player] == CSW_XM1014)
			cs_set_user_bpammo(T_Player, CSW_XM1014, cs_get_user_bpammo(T_Player, CSW_XM1014) + 6)
		else if(g_Weapon[T_Player] == CSW_M4A1)
			cs_set_user_bpammo(T_Player, CSW_M4A1, cs_get_user_bpammo(T_Player, CSW_M4A1) + 27)
		else if(g_Weapon[T_Player] == CSW_AK47)
			cs_set_user_bpammo(T_Player, CSW_AK47, cs_get_user_bpammo(T_Player, CSW_AK47) + 27)
		else if(g_Weapon[T_Player] == CSW_FAMAS)
			cs_set_user_bpammo(T_Player, CSW_FAMAS, cs_get_user_bpammo(T_Player, CSW_FAMAS) + 22)
		else if(g_Weapon[T_Player] == CSW_SG552)
			cs_set_user_bpammo(T_Player, CSW_SG552, cs_get_user_bpammo(T_Player, CSW_SG552) + 27)
		else if(g_Weapon[T_Player] == CSW_AUG)
			cs_set_user_bpammo(T_Player, CSW_AUG, cs_get_user_bpammo(T_Player, CSW_AUG) + 27)
		else if(g_Weapon[T_Player] == CSW_HEGRENADE)
			cs_set_user_bpammo(T_Player, CSW_HEGRENADE, cs_get_user_bpammo(T_Player, CSW_HEGRENADE) + 1)
	}

	return FMRES_IGNORED
}

public fw_Use(ent, idcaller, idactivator, use_type, Float:value)
{
	if(g_ButtonsDisable && g_DuelStarted && is_user_alive(idactivator) && cs_get_user_team(idactivator) == CS_TEAM_T)
	{
		new t_Cant_Drop[600 char]
		formatex(t_Cant_Drop, charsmax(t_Cant_Drop), "%L", idactivator, "DR_CANT_USE")
		print_col_chat(idactivator, "^4%s^1 %s",g_ChatPrefix, t_Cant_Drop)
		return HAM_SUPERCEDE
	}

	return HAM_IGNORED
}

public Duel_Informer()
{
	if(CountDown_Timer > 1)
	{
		set_hudmessage(255, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, -1)

		if(CountDown_Timer != 1)
		{
			for(new id = 1; id <= g_Maxplayers; id++)
			{
				new t_Time_Delay[600 char]
				formatex(t_Time_Delay, charsmax(t_Time_Delay), "%L", id, "DR_TIME_DELAY", CountDown_Timer - 1)
				ShowSyncHudMsg(id, g_MsgSync, "%s", t_Time_Delay)
			}
		}
	}
	--CountDown_Timer

	if(CountDown_Timer >= 1)
		set_task(1.0, "Duel_Informer", TASK_CONT)
	else
	{
		client_cmd(0, "spk %s", s_StartDuel[random_num(0, sizeof s_StartDuel - 1)])

		if(is_user_alive(CT_Player) && is_user_connected(CT_Player))
			fm_set_user_godmode(CT_Player, 0)

		if(is_user_alive(T_Player) && is_user_connected(T_Player))
			fm_set_user_godmode(T_Player, 0)

		remove_task(TASK_CONT)
	}
}

public Show_Ring(id)
{
	if(g_DuelStarted && is_user_alive(id) && is_user_connected(id) && !g_New_Round)
	{
		static Float:origin[3]
		pev(id, pev_origin, origin)

		if(id == CT_Player)
			Ring(origin, CT_Aura[0], CT_Aura[1], CT_Aura[2])
		else if(id == T_Player)
			Ring(origin, T_Aura[0], T_Aura[1], T_Aura[2])

		set_task(0.5, "Show_Ring", id)
	}
	else
		remove_task(id)
}


/*========================================================================================================
===============================================[ Stocks ]=================================================
========================================================================================================*/
stock fm_give_item(index, const item[])
{
	if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
		return 0

	new ent = fm_create_entity(item)
	if (!pev_valid(ent))
		return 0

	new Float:origin[3]
	pev(index, pev_origin, origin)
	set_pev(ent, pev_origin, origin)
	set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
	dllfunc(DLLFunc_Spawn, ent)

	new save = pev(ent, pev_solid)
	dllfunc(DLLFunc_Touch, ent, index)
	if (pev(ent, pev_solid) != save)
		return ent

	engfunc(EngFunc_RemoveEntity, ent)

	return -1
}

stock fm_strip_user_weapons(index)
{
	new ent = fm_create_entity("player_weaponstrip")
	if (!pev_valid(ent))
		return 0

	dllfunc(DLLFunc_Spawn, ent)
	dllfunc(DLLFunc_Use, ent, index)
	engfunc(EngFunc_RemoveEntity, ent)

	return 1
}

stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
	new Float:RenderColor[3]
	RenderColor[0] = float(r)
	RenderColor[1] = float(g)
	RenderColor[2] = float(b)

	set_pev(entity, pev_renderfx, fx)
	set_pev(entity, pev_rendercolor, RenderColor)
	set_pev(entity, pev_rendermode, render)
	set_pev(entity, pev_renderamt, float(amount))

	return 1
}

stock get_weapon_ent(id,wpnid=0,wpnName[]="")
{
	// who knows what wpnName will be
	static newName[32]

	// need to find the name
	if(wpnid) get_weaponname(wpnid,newName,31)

	// go with what we were told
	else formatex(newName,31,"%s",wpnName)

	// prefix it if we need to
	if(!equal(newName,"weapon_",7))
		format(newName,31,"weapon_%s",newName)

	new ent
	while((ent = engfunc(EngFunc_FindEntityByString,ent,"classname",newName)) && pev(ent,pev_owner) != id) {}

	return ent
}

stock fm_set_user_godmode(index, godmode = 0)
{
	set_pev(index, pev_takedamage, godmode == 1 ? DAMAGE_NO : DAMAGE_AIM)

	return 1
}

stock print_col_chat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, "!g", "^4") // Green Color
	replace_all(msg, 190, "!y", "^1") // Default Color (Yellow)
	replace_all(msg, 190, "!t", "^3") // Team Color

	if (id) players[0] = id; else get_players(players, count, "ch") 
	{
		for ( new i = 0; i < count; i++ )
		{
			if ( is_user_connected(players) )
			{
				message_begin(MSG_ONE_UNRELIABLE, SayText, _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}

UpDate_HUD(id, csw_weapon)
{
	message_begin(MSG_ONE, g_MsgCurWeapon, _, id)
	write_byte(1)
	write_byte(csw_weapon)	//CSW_weapon
	write_byte(1)	// MaxClip
	message_end()
}

Give_Scout(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_scout")

		new wEnt = get_weapon_ent(id, CSW_SCOUT)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_SCOUT, get_pcvar_num(g_ScoutBPAmmo))
		UpDate_HUD(id, wEnt)
	}

}

Give_Deagle(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_deagle")

		new wEnt = get_weapon_ent(id, CSW_DEAGLE)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_DEAGLE, get_pcvar_num(g_DeagleBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_AWP(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_awp")

		new wEnt = get_weapon_ent(id, CSW_AWP)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_AWP, get_pcvar_num(g_AWPBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_M3(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_m3")

		new wEnt = get_weapon_ent(id, CSW_M3)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_M3, get_pcvar_num(g_M3BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_XM1014(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_xm1014")

		new wEnt = get_weapon_ent(id, CSW_XM1014)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_XM1014, get_pcvar_num(g_XM1014BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_M4A1(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_m4a1")

		new wEnt = get_weapon_ent(id, CSW_M4A1)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_M4A1, get_pcvar_num(g_M4A1BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_AK47(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_ak47")

		new wEnt = get_weapon_ent(id, CSW_AK47)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_AK47, get_pcvar_num(g_AK47BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_FAMAS(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_famas")

		new wEnt = get_weapon_ent(id, CSW_FAMAS)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_FAMAS, get_pcvar_num(g_FAMASBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_SG552(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_sg552")

		new wEnt = get_weapon_ent(id, CSW_SG552)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_SG552, get_pcvar_num(g_SG552BPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_AUG(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_aug")

		new wEnt = get_weapon_ent(id, CSW_AUG)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_AUG, get_pcvar_num(g_AUGBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Give_HEGRENADE(id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		fm_give_item(id, "weapon_hegrenade")

		new wEnt = get_weapon_ent(id, CSW_HEGRENADE)

		if(pev_valid(wEnt) && get_pcvar_num(g_OneShot))
			cs_set_weapon_ammo(wEnt, 1)

		cs_set_user_bpammo(id, CSW_HEGRENADE, get_pcvar_num(g_HEGRENADEBPAmmo))
		UpDate_HUD(id, wEnt)
	}
}

Weapon_ReChek(id, Weap)
{
	if(get_pcvar_num(g_OneShot) && is_user_alive(id) && is_user_connected(id))
	{
		new wEnt = get_weapon_ent(id, Weap)
		if(pev_valid(wEnt))
		{
			cs_set_weapon_ammo(wEnt, 1)
			UpDate_HUD(id, wEnt)
		}
	}
}

Ring(const Float:origin[3], R, G, B)
{
	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
	write_byte(TE_BEAMCYLINDER) // TE id
	engfunc(EngFunc_WriteCoord, origin[0]) // x	10
	engfunc(EngFunc_WriteCoord, origin[1]) // y
	engfunc(EngFunc_WriteCoord, origin[2]) // z
	engfunc(EngFunc_WriteCoord, origin[0]-50.0) // x axis
	engfunc(EngFunc_WriteCoord, origin[1]) // y axis
	engfunc(EngFunc_WriteCoord, origin[2]+100.0) // z axis
	write_short(RingSprite) // sprite
	write_byte(0) // startframe
	write_byte(0) // framerate
	write_byte(5) // life
	write_byte(5) // width
	write_byte(0) // noise
	write_byte(R) // red
	write_byte(G) // green
	write_byte(B) // blue
	write_byte(200) // brightness
	write_byte(0) // speed
	message_end()
}
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
tre3fla
Membru eXtream
Membru eXtream
Posts: 5333
Joined: 27 May 2012, 10:15
Detinator Steam: Da
CS Status: Allah Akbar !
Detinator server CS: Nu
SteamID: /id/tre3fla_xxx
Has thanked: 14 times
Been thanked: 129 times

11 Jul 2012, 12:32

Esti eroul meu stiai? :*
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 29 guests