Raised This Month: $75 Target: $400
 18% 

Move Ct to zm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ykaru
Junior Member
Join Date: Aug 2019
Old 08-11-2019 , 09:03   Move Ct to zm
Reply With Quote #1

Hi, could you help me with a plugin that moves CT players when they are killed by Zombie on their team.
But to move them only during the round, he finally gave them back.
I have the basic builder plugin, but I see that this does not.

This is the base builder plugin :

Code:
#include <amxmodx>

#include <amxmisc>

#include <cstrike>

#include <fakemeta>

#include <fakemeta_util>

#include <engine> 

#include <hamsandwich>

#include <fun>

#include <csstats>

#include <csx>

#include <xs>





// Plugin Version 

new VERSION[]="5.5"

new formatmodname[] = "^x01 [^x04 BBx.PlayArena.Ro^x01 ]"



//Models

new const g_ZombieModel[3][] = 

{

	"bb_vipTT", // vip

	"bb_adminTT", // admin

	"bb_playerTs"  // player

}

new const g_HumanModel[3][] =

{

	"bb_vipCT", // vip

	"bb_adminCT", // admin

	"bb_playerCT"  // player

}



//Sounds

new g_RoundStart[] = "basebuilder/round_start.wav"



#define MAX_PLAYERS 32

#define AMMO_SLOT 376

#define MODELSET_TASK 100

#define MODELCHANGE_DELAY 0.5

#define MAXENTS 1365

#define TASK_ROUND 1023

#define AUTO_TEAM_JOIN_DELAY 0.1

#define TEAM_SELECT_VGUI_MENU_ID 2

#define BARRIER_COLOR 0.0, 0.0, 0.0

#define BARRIER_RENDERAMT 150.0



#define AFTER_BUILD ADMIN_LEVEL_D

#define DEAD_BUILD ADMIN_LEVEL_A

#define REMOVE_BLOCK ADMIN_LEVEL_A

#define DEAD_REMOVE ADMIN_LEVEL_D

#define LOCK_BLOCKS ADMIN_LEVEL_A

#define PAIN_SHOCK_FREE ADMIN_KICK

#define BAD_SPAWN ADMIN_LEVEL_F

#define BUILD_BAN ADMIN_LEVEL_F

#define REVIVE ADMIN_LEVEL_F

#define SWAP ADMIN_LEVEL_F

#define START_ROUND ADMIN_LEVEL_F

#define ACCES_HP ADMIN_LEVEL_B

#define ACCES_HELP ADMIN_LEVEL_A

#define ADMIN_MODEL ADMIN_LEVEL_H

#define VIP ADMIN_LEVEL_B



          







#if cellbits == 32

    #define OFFSET_BUYZONE 235

#else

    #define OFFSET_BUYZONE 268

#endif



#define LockBlock(%1)     ( entity_set_int( %1, EV_INT_iuser1, 1 ) )

#define UnlockBlock(%1)   ( entity_set_int( %1, EV_INT_iuser1, 0 ) )

#define IsBlockLocked(%1) ( entity_get_int( %1, EV_INT_iuser1 ) == 1 )



// CS Weapon CBase Offsets (win32)

const OFFSET_WEAPONOWNER = 41



// Linux diff's

const OFFSET_LINUX_WEAPONS = 4



new gmsgStatusText

new gmsgSayText

new gHudSyncInfo

new g_MaxPlayers

const fPainShock = 108



new bool:g_CanBuild

new bool:g_ZombiesReleased

new g_RoundNum

new g_iEntBarrier

new bool:g_BuildBan[MAX_PLAYERS+1]

new g_pEnt[MAX_PLAYERS+1], g_pDist[MAX_PLAYERS+1]

new bool:g_MovingEnt[MAXENTS]

new g_EntMover[MAXENTS]

new g_LastMover[MAXENTS]

new g_EntOwner[MAXENTS]

new g_OwnedEnts[33]

new needhelp[33]

new Float:fOrigin[3]



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







//Custom Model Stuff

new Float:g_ModelsTargetTime, Float:g_RoundStartTime

new g_HasCustomModel[MAX_PLAYERS+1], g_PlayerModel[MAX_PLAYERS+1][32]



new g_ModName[32]

new g_CurrentWeapon[MAX_PLAYERS+1]

new g_PrimaryWeapon[MAX_PLAYERS+1]



// Allowed weapons for zombies

const ZOMBIE_ALLOWED_WEAPONS_BITSUM = (1<<CSW_KNIFE)



new g_pcvar_team, g_pcvar_class, g_pcvar_buildtime, g_pcvar_zombiehp, g_pcvar_maxrounds, g_pcvar_basecalc,

	g_pcvar_givenades, g_pcvar_allowedweps, g_pcvar_tournymode, g_pcvar_showmovers, g_pcvar_healthtime,

	g_pcvar_blockgrav, g_pcvar_knockback, g_pcvar_entmindist, g_pcvar_entsetdist, g_pcvar_entmaxdist,

	g_pcvar_roundnum, g_pcvar_roundtime, g_pcvar_resetent, g_pcvar_zresptime, g_pcvar_maxclaimable,

	g_pcvar_claimable, g_pcvar_incalzire

	

new g_friend[MAX_PLAYERS+1]

new g_iMsgIdHostagePos, g_iMsgIdHostageK



//Cached Stuff for Players

new g_isconnected[MAX_PLAYERS+1]

new g_isalive[MAX_PLAYERS+1] 

new g_ishuman[MAX_PLAYERS+1]

new g_iszombie[MAX_PLAYERS+1]



//CSDM-Style Weapons Menu

new bool:firsttime[MAX_PLAYERS+1],bool:ask[MAX_PLAYERS+1]

new weapon_picked[2][MAX_PLAYERS+1],cur_offset[MAX_PLAYERS+1],options_on_menu[8][MAX_PLAYERS+1]



new count_down



// Weapon entity names

new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",

			"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",

			"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",

			"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",

			"weapon_ak47", "weapon_knife", "weapon_p90" }

			

static const WEAPONNAMES[24][23] = { "Schmidt Scout", "XM1014 M4", "Ingram MAC-10", "Steyr AUG A1", "UMP 45", "SG-550 Auto-Sniper",

			"IMI Galil", "Famas", "AWP Magnum Sniper", "MP5 Navy", "M249 Para Machinegun", "M3 Super 90", "M4A1 Carbine",

			"Schmidt TMP", "G3SG1 Auto-Sniper", "SG-552 Commando", "AK-47 Kalashnikov", "ES P90", "P228 Compact",

			"Dual Elite Berettas", "Fiveseven", "USP .45 ACP Tactical", "Glock 18C", "Desert Eagle .50 AE"

}

new g_SendTeam[33]

new beamSpr



public plugin_init()

{

	register_plugin("Base Builder Zombie Mod", VERSION, "Tirant")

	register_cvar("base_builder", VERSION, FCVAR_SPONLY|FCVAR_SERVER)

	set_cvar_string("base_builder", VERSION)

		

	g_pcvar_buildtime = register_cvar("bb_build_time", "135")

	g_pcvar_incalzire = register_cvar("bb_warm_time", "30")

	g_pcvar_zombiehp = register_cvar("bb_zombie_health", "3500")

	g_pcvar_basecalc = register_cvar("bb_calc_maxbase", "0")

	g_pcvar_tournymode = register_cvar("bb_tournament_mode", "0")

	g_pcvar_showmovers = register_cvar("bb_show_moving", "1")

	g_pcvar_blockgrav = register_cvar("bb_block_gravity", "0")

	g_pcvar_knockback = register_cvar("bb_pain_shock_free", "0")

	g_pcvar_entmaxdist = register_cvar("bb_max_move_dist", "1400")

	g_pcvar_entmindist = register_cvar("bb_min_move_dist", "0")

	g_pcvar_entsetdist = register_cvar("bb_min_dist_set", "64")

	g_pcvar_healthtime = register_cvar("bb_health_time", "12")

	g_pcvar_resetent = register_cvar("bb_reset_blocks", "1")

	g_pcvar_roundtime = register_cvar("bb_roundtime", "7")

	g_pcvar_zresptime = register_cvar("bb_zombie_respawn_time", "0")

	g_pcvar_roundnum = register_cvar("bb_rounds", "8")

	g_pcvar_maxrounds = get_cvar_num("mp_maxrounds")

	g_pcvar_maxclaimable = register_cvar("bb_claim_max", "15")

	g_pcvar_claimable = register_cvar("bb_claim_mode", "3")

		

	//AJC for auto team (if needed)

	g_pcvar_team = register_cvar("bb_team", "5")

	g_pcvar_class = register_cvar("bb_class", "5")

	/////////Mseaj....

	set_task(90.0,"show_mesaje",0,"",0,"b",0)

	

	//Guns Menu

	g_pcvar_givenades = register_cvar("bb_give_nades","hhssf") //h f s, put multiple letters for multiple nades

	g_pcvar_allowedweps = register_cvar("bb_weapons","abcdeghijlmnqrstuvwx")

	

	//Client Commands

	register_clcmd("+grab","cmdMoveEnt",_," - Starts moving the selected object") 		//command to move stuff around

	register_clcmd("-grab","cmdStopEnt",_," - Stops moving the selected object") 		//command to move stuff around

	register_clcmd("say /respawn","Respawn_Zombie",_," - Respawn while dead (Zombie)")	//command to respawn (zombies only)

	register_clcmd("say /fixspawn","cmdBadSpawn",_," - Respawn while dead (Survivor)")	//command to respawn (humans only before buildtime)

	register_clcmd("say /ajutor","cmdHelp",_," - Displays the help hud") 			//command to see /help menu

	register_clcmd("say /ajutor","cmdHelp",_," - Displays the help hud") 			//command to see /help menu

	register_clcmd("say /runda","cmdCheckRound",_," - Displays the round number")

	register_clcmd("say /round","cmdCheckRound",_," - Displays the round number")		//command to see the current round number

	register_clcmd("say round","cmdCheckRound",_," - Displays the round number")		//command to see the current round number

	register_clcmd("say /team","team")

	register_clcmd("say /help", "say_help",_," - NeedHelp")

	

	//Guns Menu

	register_clcmd("say guns","cmdGuns",_," - Opens the guns menu") 				//Guns Menu CMD

	register_clcmd("say_team guns","cmdGuns",_," - Opens the guns menu")			//Guns Menu CMD

	register_clcmd("say /guns","cmdGuns",_," - Opens the guns menu")			//Guns Menu CMD

	register_clcmd("say_team /guns","cmdGuns",_," - Opens the guns menu")			//Guns Menu CMD

	

	//Admin Commands

	register_concmd("removeaimmm","cmdRemoveEnt",_," - Deletes an object") 			//Removes an object (C alive, D dead)

	register_concmd("lockaimmmm","cmdLockBlock",_," - Locks/Unlocks an object from moving")	//Once to lock, again to unlock

	register_concmd("unclaimaimmm","cmdRemoveClaim",_," - Removes a claim on an object")	//Makes block claimable by everyone

	register_concmd("say /fixspawns","cmdBadSpawn_Survivor",_," - Respawns all dead CTs") 	//Global /fixspawn command (Kick)

	register_concmd("say /respawns","cmdBadSpawn_Zombie",_," - Respawns all dead Ts") 	//Global /respawn command (Kick)

	register_concmd("bb_buildban","cmdBuildBan",_,"<player>") 				//Bans targeted player from building

	register_concmd("bb_unbuildban","cmdBuildUnban",_,"<player>") 				//Unbans   "	   "     "     "

	register_concmd("bb_revive","cmdRevive",_,"<player>")					//revives targetted player

	register_concmd("bb_swap","cmdSwap",_,"<player>")					//swaps the selected player to the opposite team

	register_concmd("bb_startround","cmdStartRound",_," - Ends the build phase")		//do i really have to explain this?

	register_concmd("bb_unhelp", "unhelp",_," - UnHelp player")

	

	//Blocked Commands

	register_clcmd("drop", "clcmd_drop")

	register_clcmd("buy", "clcmd_buy")

	register_clcmd("+hook", "hook")

	

	

	

	new tournymode = get_pcvar_num(g_pcvar_tournymode)

	if (tournymode != 1)

	{

		register_clcmd("chooseteam", "clcmd_changeteam")

		register_clcmd("jointeam", "clcmd_changeteam")

	}

	

	register_forward(FM_GetGameDescription, "fw_GetGameDescription")

	register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")

	register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")

	register_forward(FM_PlayerPreThink, "fw_Player_PreThink")

	register_forward(FM_ClientKill, "fw_Suicide")

	//register_forward(FM_CmdStart, "fw_CmdStart")

	if (get_pcvar_num(g_pcvar_showmovers) == 1)

		register_forward(FM_TraceLine, "fw_Traceline", 1)

	

	RegisterHam(Ham_Touch, "weapon_shield", "ham_WeaponCleaner_Post", 1)

	RegisterHam(Ham_Touch, "weaponbox", "ham_WeaponCleaner_Post", 1)

	RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)

	for (new i = 1; i < sizeof WEAPONENTNAMES; i++)

		if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "ham_ItemDeploy_Post", 1)



	

	register_message(get_user_msgid("TextMsg"), "msgRoundEnd")

	register_message(get_user_msgid("StatusIcon"), "msgStatusIcon")

	register_message(get_user_msgid("StatusValue"), "msgStatusValue");

	if (tournymode != 1)

	{

		register_message(get_user_msgid("ShowMenu"), "message_show_menu")

		register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")

	}

	

	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

	register_event("AmmoX", "ev_AmmoX", "be", "1=1", "1=2", "1=3", "1=4", "1=5", "1=6", "1=7", "1=8", "1=9", "1=10")

	register_event("StatusValue", "ev_SetTeam", "be", "1=1");

	register_event("StatusValue", "ev_ShowStatus", "be", "1=2", "2!0");

	register_event("StatusValue", "ev_HideStatus", "be", "1=1", "2=0");

	register_event("Health", "ev_Health", "be", "1>0");

		

	register_logevent("logevent_round_start",2, "1=Round_Start")

	register_logevent("logevent_round_end", 2, "1=Round_End")

	

	register_menucmd(register_menuid("WeaponMethodMenu"),(1<<0)|(1<<1)|(1<<2),"weapon_method_pushed")

	register_menucmd(register_menuid("PrimaryWeaponSelect"),(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9),"prim_weapons_pushed")

	register_menucmd(register_menuid("SecWeaponSelect"),(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7),"sec_weapons_pushed")



	set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)

	

	//Formats the Mod Name

	formatex(g_ModName, charsmax(g_ModName), "Base Builder %s", VERSION)

	

	g_iMsgIdHostagePos = get_user_msgid("HostagePos")

	g_iMsgIdHostageK = get_user_msgid("HostageK")



	register_dictionary("basebuilder.txt");

	

	gmsgSayText = get_user_msgid("SayText")

	gmsgStatusText = get_user_msgid("StatusText");

	gHudSyncInfo = CreateHudSyncObj();

	g_MaxPlayers = get_maxplayers()



	if (tournymode != 1)

	{

		server_cmd("mp_limitteams 1")

		server_cmd("mp_autoteambalance 1")

	}

	else

	{

		server_cmd("mp_limitteams 0")

		server_cmd("mp_autoteambalance 0")		

	}

	new roundnum = get_pcvar_num(g_pcvar_roundnum)

	server_cmd("mp_freezetime 0")

	server_cmd("mp_flashlight 0")

	server_cmd("mp_maxrounds %d", roundnum)

	server_cmd("mp_winlimit %d", roundnum)

	server_cmd("mp_roundtime %d", get_pcvar_num(g_pcvar_roundtime))

	register_event("DeathMsg","Event_DeathMsg","a") 

	g_iEntBarrier = find_ent_by_tname( -1, "barrier" );

}



public show_mesaje(id){



      client_print(0,print_chat,"Nu uitati sa adaugati serverul la Favorite.")

}



public hook(id) 

{

	if(!is_user_alive(id)||!g_CanBuild)

		return 1



	if(cs_get_user_team(id) != CS_TEAM_CT)

		return 1



	if(!task_exists(id+333221))

		set_task(0.1,"hooks",id+333221)



	return 1

}

public hooks(id)

{

	id -= 333221



	if(!is_user_alive(id))

		return 0



	if(cs_get_user_team(id) != CS_TEAM_CT)

		return 0



	static origin1[3]

	get_user_origin(id,origin1)



	static origin2[3]

	get_user_origin(id,origin2,3)



	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)

	write_byte(1)

	write_short(id)

	write_coord(origin2[0])

	write_coord(origin2[1])

	write_coord(origin2[2])

	write_short(beamSpr)

	write_byte(0)

	write_byte(30)

	write_byte(10)

	write_byte(100)

	write_byte(10)

	write_byte(random_num(0,200))

	write_byte(random_num(0,200))

	write_byte(random_num(0,200))

	write_byte(10)

	write_byte(10)

	message_end()



	static Float:velocity[3]

	velocity[0] = (float(origin2[0]) - float(origin1[0])) * 3.0

	velocity[1] = (float(origin2[1]) - float(origin1[1])) * 3.0

	velocity[2] = (float(origin2[2]) - float(origin1[2])) * 3.0



	static Float:y

	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2]



	static Float:x

	x = (5.0 * 120.0) / floatsqroot(y)



	velocity[0] *= x

	velocity[1] *= x

	velocity[2] *= x



	set_pev(id,pev_velocity,velocity)

	return 0

}

public team(id)

{

	menu_players(id,"chooseplayer")

}

public chooseplayer(id, menu, item)

{

	if(item == MENU_EXIT)

	{

		menu_destroy(menu);

		return PLUGIN_HANDLED;

	}



	new dst[32], data[5], access, callback, player;



	menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback);

	player = str_to_num(data);



	if(is_user_alive(player))

	{

		new name[33]

		get_user_name(id, name, 32)

		g_SendTeam[player] = id

		new zorken[50]

		formatex(zorken,49,"\r%s \wvrea sa faca team cu tine.",name)

		new menu = menu_create(zorken, "acceptc");

		menu_additem( menu, "\yAccepta","1");

		menu_additem( menu, "\dRefuza","2");



		menu_display(player, menu);

	}

	return PLUGIN_HANDLED;

}

public acceptc(id,menu,item)

{

	if(item == MENU_EXIT||!g_CanBuild)

	{

		if(is_user_alive(g_SendTeam[id]) && g_CanBuild)

		{

			client_print(id,print_chat,"^x04[BBx.PlayArena.Ro]^x01 Ai refuzat team-ul.")

			new name[33]

			get_user_name(id,name,32)

			client_print(g_SendTeam[id],print_chat,"^x04[BBx.PlayArena.Ro]^x01 %s a refuzat team-ul tau.",name)

			g_SendTeam[id] = 0

		}

		menu_destroy(menu);

		return PLUGIN_HANDLED;

	}

	new dst[32], data[5], access, callback;



	menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback);

	new nr = str_to_num(data);

	if(nr == 1)

	{

		if(is_user_alive(g_SendTeam[id]))

		{

			client_print(id,print_chat,"^x04[BBx.PlayArena.Ro]^x01 Ai acceptat team-ul.")

			new name[33]

			get_user_name(id,name,32)

			client_print(g_SendTeam[id],print_chat,"^x04[BBx.PlayArena.Ro]^x01 %s a acceptat team-ul tau.",name)

			g_SendTeam[id] = 0

		}

	}

	else if(nr == 2)

	{

		if(is_user_alive(g_SendTeam[id]))

		{

			client_print(id,print_chat,"^x04[BBx.PlayArena.Ro]^x01 Ai refuzat team-ul.")

			new name[33]

			get_user_name(id,name,32)

			client_print(g_SendTeam[id],print_chat,"^x04[BBx.PlayArena.Ro]^x01 %s a refuzat team-ul tau.",name)

			g_SendTeam[id] = 0

		}

	}

}

stock menu_players(index,handle[])

{

	new i, name[32], num[5], menu;

	menu = menu_create("Team CT", handle);

	for(i = 1; i <= 32; i++)

	{

		if(!is_user_alive(i)||i == index||g_SendTeam[i]||!g_CanBuild)

			continue;



 		if(cs_get_user_team(i) == CS_TEAM_CT)

		{

			get_user_name(i, name, charsmax(name));

			num_to_str(i, num, charsmax(num));

			menu_additem(menu, name, num, 0);

		}

	}

	menu_display(index, menu);

}

public Event_DeathMsg()

{

	new g_attacker = read_data(1);

	new g_victim = read_data(2);

	



	cmdStopEnt(g_victim)

	

	set_hudmessage(_, _, _, _, _, _, _, _, _, _, 4);

	show_hudmessage(g_victim, "");

	

	g_isalive[g_victim] = false

	

	if (g_iszombie[g_victim] && g_attacker == g_victim)

	{

		set_task(0.2,"Respawn_Zombie",g_victim)

	}

	else if (g_iszombie[g_victim])

	{

		set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1)

		show_hudmessage(g_victim, "%L", LANG_SERVER, "DEAD_ZOMBIE", get_pcvar_num(g_pcvar_zresptime));

		set_task(get_pcvar_float(g_pcvar_zresptime), "Respawn_Zombie", g_victim)

	}

	if (g_ishuman[g_victim])

	{

		set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1)

		show_hudmessage(g_victim, "%L", LANG_SERVER, "DEAD_SURVIVOR");

	}



	needhelp[g_victim] = 0

	return 0;

}  



public plugin_precache()

{

	beamSpr = precache_model("sprites/lgtning.spr")

	new szModel[ 64 ];

	

	for(new i;i<sizeof(g_ZombieModel);i++)

	{

		format( szModel, charsmax( szModel ), "models/player/%s/%s.mdl", g_ZombieModel[i], g_ZombieModel[i] );

		engfunc( EngFunc_PrecacheModel, szModel );

	}

	for(new i;i<sizeof(g_HumanModel);i++)

	{

		format( szModel, charsmax( szModel ), "models/player/%s/%s.mdl", g_HumanModel[i], g_HumanModel[i] );

		engfunc( EngFunc_PrecacheModel, szModel );

	}



	engfunc( EngFunc_PrecacheSound, g_RoundStart )



	new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_bomb_target"))

	if (ent) 

	{

		dllfunc(DLLFunc_Spawn, ent)

		set_pev(ent, pev_solid, SOLID_NOT)

	}

	

	new iBuyZone = create_entity("info_map_parameters");

	DispatchKeyValue(iBuyZone, "bombradius", "0");

	DispatchKeyValue(iBuyZone, "buying", "3");

	DispatchSpawn(iBuyZone);

}



// Event Round Start (This is before freeze time)

public event_round_start()

{

	g_RoundStartTime = get_gametime()

	g_ZombiesReleased = false

	

	if (get_pcvar_num(g_pcvar_resetent) == 1)

	{

		new cname[10], tname[7];

		for (new iEnt = g_MaxPlayers+1; iEnt < MAXENTS; iEnt++)

		{

			if( is_valid_ent(iEnt) )

			{

				entity_get_string(iEnt, EV_SZ_classname, cname, 9);

				entity_get_string(iEnt, EV_SZ_targetname, tname, 6);

				if ( !IsBlockLocked(iEnt) && iEnt != g_iEntBarrier && equal(cname, "func_wall") && !equal(tname, "ignore"))

					engfunc( EngFunc_SetOrigin, iEnt, Float:{ 0.0, 0.0, 0.0 } );

			}

		}

	}

}



public cmdHelp(id)

{

	set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 15.0, 0.1, 0.2, 2)

	new nLen, szHelp[512]

	nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "WELCOME_MSG", VERSION);

	nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "BIND_KEY");

	nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE1");

	nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE2");

	nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE3");

	nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE4");

	nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE5");

	show_hudmessage(id, szHelp);

}



// Log Event Round Start (This is AFTER freeze time)

public logevent_round_start()

{

	set_pev(g_iEntBarrier,pev_solid,SOLID_BSP)

	DispatchKeyValue(g_iEntBarrier, "rendermode", "1");

	DispatchKeyValue(g_iEntBarrier, "renderamt", "100");

	DispatchKeyValue(g_iEntBarrier, "rendercolor", "0.0 0.0 0.0");



	//set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransColor, 95);

	//set_pev(g_iEntBarrier,pev_solid,SOLID_BSP)

	//set_pev(g_iEntBarrier,pev_rendermode,1)

	//DispatchKeyValue(g_iEntBarrier, "renderamt", "255");



	set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1)

	new nLen, szMsg[128]

	nLen += format( szMsg[nLen], 127-nLen, "%L", LANG_SERVER, "WELCOME_MSG", VERSION);

	nLen += format( szMsg[nLen], 127-nLen, "%L", LANG_SERVER, "BIND_KEY");

	show_hudmessage(0, szMsg);

	

	print_color(0, "%s %s ^x04- ^x01%L", formatmodname, VERSION, LANG_SERVER, "ROUND_MSG")

	print_color(0, "%s Round: %d of %d", formatmodname, (g_RoundNum+1), g_pcvar_maxrounds)

	if(g_RoundNum+1 == 5)

	{

		set_task(1.5,"vote")

	}

	if(g_RoundNum+1 == 9)

	{

		new nextmap[32]

		getNextMapName(nextmap, charsmax(nextmap))

		server_cmd("changelevel %s",nextmap)

	}

	remove_task(TASK_ROUND)

	remove_task(30000)

	remove_task(30001)

	

	new iBuildTime = get_pcvar_num( g_pcvar_buildtime );

	new TotalTime = iBuildTime+get_pcvar_num( g_pcvar_incalzire )

	set_task(1.0, "CountDown", 30000, "", 0, "a", iBuildTime);

	count_down = (iBuildTime-1);

	set_task(float(TotalTime), "Release_Zombies", TASK_ROUND)

	

	if (get_pcvar_num(g_pcvar_basecalc) == 1)

		set_task(5.0, "Base_Calc")

		

	set_task(5.0, "Fix_Spawns")

	

	g_CanBuild = true



	arrayset(g_MovingEnt, false, MAXENTS)

	arrayset(g_EntOwner, 0, MAXENTS)

	arrayset(g_OwnedEnts, 0, g_MaxPlayers+1)

}

public vote()

{



}

getNextMapName(szArg[], iMax)

{

	new len = get_cvar_string("amx_nextmap", szArg, iMax)

	return len

}

public CountDown()

{

	set_hudmessage(255, 255, 255, -1.0, 0.0, 0, 0.1, 0.9, 0.1, 0.2, 3)

	show_hudmessage(0, "%L", LANG_SERVER, "BUILD_TIME", count_down--);

	

	if (count_down < 0)

	{

		remove_task(30000);

		new iBuildTime = get_pcvar_num( g_pcvar_incalzire );

		set_task(1.0, "WarmUp", 30001, "", 0, "a", iBuildTime);

		count_down = (iBuildTime-1);

		for(new i; i < 32; i++)

		{

			if(is_user_connected(i) && cs_get_user_team(i) == CS_TEAM_CT)

			{

				if(is_user_alive(i))

					spawn(i);

				else

					ExecuteHamB(Ham_CS_RoundRespawn, i);

			}

			cmdStopEnt(i)

		}

		g_CanBuild = false

	}

}

public WarmUp()

{

	set_hudmessage(255, 255, 255, -1.0, 0.0, 0, 0.1, 0.9, 0.1, 0.2, 3)

	show_hudmessage(0, "Mai aveti: %i secunde sa ajungeti la baza!", count_down--);

	

	if (count_down < 0)

	{

		remove_task(30001);

		new iBuildTime = get_pcvar_num( g_pcvar_incalzire );

		set_task(1.0, "WarmUp", 30001, "", 0, "a", iBuildTime);

		count_down = (iBuildTime-1);

	}

}

//Resets stuff and swaps teams so they respawn correctly

public logevent_round_end()

{

	if (!g_CanBuild && get_pcvar_num(g_pcvar_tournymode) != 1)

	{

		new players[32], num

		get_players(players, num)

		

		new player

		for (new i = 0; i < num; i++)

		{

			player = players[i]

			cs_set_user_team(player, cs_get_user_team(player) == CS_TEAM_T ? CS_TEAM_CT:CS_TEAM_T)

			remove_task(player+500)



			needhelp[player] = 0



			if (cs_get_user_team(player) == CS_TEAM_T)

			{

				g_iszombie[player] = true

				g_ishuman[player] = false

			}

			if (cs_get_user_team(player) == CS_TEAM_CT)

			{

				g_ishuman[player] = true

				g_iszombie[player] = false

			}

		}

		print_color(0, "^x04%L", LANG_SERVER, "TEAMS_SWAPPED")

	}

	

	remove_task(TASK_ROUND)

	remove_task(30000)

	remove_task(30001)

	return PLUGIN_HANDLED

}



public ham_TakeDamage_Post(victim, inflictor, attacker, Float:damage, bits)

{

	if(get_pcvar_num(g_pcvar_knockback) == 1 && access(victim, PAIN_SHOCK_FREE) && g_iszombie[victim])

	{

		set_pdata_float(victim, fPainShock, 1.0, 5)

	}

}



public client_disconnect(id)

{

	cmdStopEnt(id)



	g_isconnected[id] = false

	g_isalive[id] = false

	g_ishuman[id] = false

	g_iszombie[id] = false



	return PLUGIN_CONTINUE

}



//Respawns late joiners, cts only if build time is still on

public client_putinserver(id)

{

	set_task(7.0,"Respawn_Human",id);

	g_isconnected[id] = true

	firsttime[id] = true

	ask[id] = true

	needhelp[id] = 0

	g_SendTeam[id] = 0

}



public Release_Zombies()

{

	g_ZombiesReleased = true

	remove_task(30000);

	remove_task(30001);

	

	new players[32], num

	get_players(players, num)



	new player

	for(new i = 0; i < num; i++)

	{

		player = players[i]

		if (g_isalive[player])

		{

			if (get_user_godmode(player))

				set_user_godmode(player, 0)

			if (g_ishuman[player])

			{

				cmdStopEnt(player)



				new weapon[32]

				get_pcvar_string(g_pcvar_givenades,weapon,31)

			

				new he, flash, smoke

				for(new i=0;i<strlen(weapon);i++)

				{

					switch(weapon[i])

					{

						case 'h': he++

						case 'f': flash++

						case 's': smoke++

					}

				}

				if(he) give_item(player,"weapon_hegrenade"), cs_set_user_bpammo(player,CSW_HEGRENADE,he)

				if(flash) give_item(player,"weapon_flashbang"), cs_set_user_bpammo(player,CSW_FLASHBANG,flash)

				if(smoke) give_item(player,"weapon_smokegrenade"), cs_set_user_bpammo(player,CSW_SMOKEGRENADE,smoke)

				

				if (g_PrimaryWeapon[player])

				{

					get_weaponname(g_PrimaryWeapon[player],weapon,31)

					engclient_cmd(player, weapon);

				}

			}

		}

	}

			

	set_pev(g_iEntBarrier,pev_solid,SOLID_NOT)

	DispatchKeyValue(g_iEntBarrier, "renderamt", "0");

	

	g_RoundNum++

	set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1)

	show_hudmessage(0, "%L", LANG_SERVER, "RELEASE_MSG");

	client_cmd(0, "spk %s", g_RoundStart)

}



//Called on zombie death function

public Respawn_Zombie(id)

{

	if (g_isconnected[id] && cs_get_user_team(id) == CS_TEAM_T)

	{

		if (get_user_health(id) == get_pcvar_float(g_pcvar_zombiehp) || !is_user_alive(id))

			ExecuteHamB(Ham_CS_RoundRespawn, id)

		else

			client_print(id, print_center, "%L", LANG_SERVER, "FAIL_RESPAWN");

	}

}



//Called on all players for late joiners, parent is above

public Respawn_Human(id)

{

	if (!g_isconnected[id] || g_isalive[id] || cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)

		return PLUGIN_HANDLED

		

	if (!g_isalive[id] && g_iszombie[id])

		ExecuteHamB(Ham_CS_RoundRespawn, id)

				

	if (!g_isalive[id] && g_iszombie[id])

		set_task(3.0,"Respawn_Human",id)

			

	if (g_CanBuild)

	{

		if (!g_isalive[id])

			ExecuteHamB(Ham_CS_RoundRespawn, id)

				

		if (!g_isalive[id])

			set_task(3.0,"Respawn_Human",id)

	}

	return PLUGIN_HANDLED

}



//Sets player health and weapons

public Add_Effects(id)

{

	if (!g_isconnected[id] || !g_isalive[id])

		return PLUGIN_HANDLED

	

	strip_user_weapons(id)

	give_item(id, "weapon_knife")

	

	if (cs_get_user_team(id) == CS_TEAM_T)

	{

		if (g_CanBuild)

			set_user_godmode(id, 1)

		if(access(id, ACCES_HP))

			set_pev(id, pev_health, 5000.0)

		else

			set_pev(id, pev_health, get_pcvar_float(g_pcvar_zombiehp)) // use decimal number

	}

	if (cs_get_user_team(id) == CS_TEAM_CT)

	{

		if(access(id, ACCES_HP))

			set_pev(id, pev_health, 200.0)



		weapon_method_menu(id)

	}

	ShowHealth(id)

	return PLUGIN_HANDLED

}



//AmmoX Ensures BackPack ammo is always full

public ev_AmmoX(id)

{

	set_pdata_int(id, AMMO_SLOT + read_data(1), 200, 5)

} 



public fw_GetGameDescription()

{

	forward_return(FMV_STRING, g_ModName)

	

	return FMRES_SUPERCEDE;

}



public ham_PlayerSpawn_Post(id)

{

	if (!is_user_alive(id) || !cs_get_user_team(id))

		return

		

	set_task(1.0, "Add_Effects", id)

	if (cs_get_user_team(id) == CS_TEAM_CT)

	{

		g_ishuman[id] = true

		g_iszombie[id] = false

	}

	if (cs_get_user_team(id) == CS_TEAM_T)

	{

		g_iszombie[id] = true

		g_ishuman[id] = false

	}

	needhelp[id] = 0

	g_isalive[id] = true

	remove_task(id + MODELSET_TASK)

	if (g_iszombie[id])

	{

		g_HasCustomModel[id] = false

		if(access(id, VIP))

			copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel[0])

		else if(access(id, ADMIN_MODEL))

			copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel[1])

		else

			copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel[2])



		new currentmodel[32]

		fm_get_user_model(id, currentmodel, charsmax(currentmodel))

		if (!equal(currentmodel, g_PlayerModel[id]))

		{

			if (get_gametime() - g_RoundStartTime < 5.0)

				set_task(5.0 * MODELCHANGE_DELAY, "fm_user_model_update", id + MODELSET_TASK)

			else

				fm_user_model_update(id + MODELSET_TASK)

		}

	}

	else if(g_ishuman[id])

	{

		g_HasCustomModel[id] = false

		if(access(id, VIP))

			copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_HumanModel[0])

		else if(access(id, ADMIN_MODEL))

			copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_HumanModel[1])

		else

			copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_HumanModel[2])



		new currentmodel[32]

		fm_get_user_model(id, currentmodel, charsmax(currentmodel))

		if (!equal(currentmodel, g_PlayerModel[id]))

		{

			if (get_gametime() - g_RoundStartTime < 5.0)

				set_task(5.0 * MODELCHANGE_DELAY, "fm_user_model_update", id + MODELSET_TASK)

			else

				fm_user_model_update(id + MODELSET_TASK)

		}

	}

}



public fw_SetClientKeyValue(id, const infobuffer[], const key[])

{   

	if (g_HasCustomModel[id] && equal(key, "model"))

		return FMRES_SUPERCEDE

	return FMRES_IGNORED

}



public fw_ClientUserInfoChanged(id)

{

	if (!g_HasCustomModel[id])

		return FMRES_IGNORED



	static currentmodel[32]

	fm_get_user_model(id, currentmodel, charsmax(currentmodel))

	if (!equal(currentmodel, g_PlayerModel[id]) && !task_exists(id + MODELSET_TASK))

		fm_set_user_model(id + MODELSET_TASK)

	return FMRES_IGNORED

}



public fm_user_model_update(taskid)

{

	static Float:current_time

	current_time = get_gametime()

	

	if (current_time - g_ModelsTargetTime >= MODELCHANGE_DELAY)

	{

		fm_set_user_model(taskid)

		g_ModelsTargetTime = current_time

	}

	else

	{

		set_task((g_ModelsTargetTime + MODELCHANGE_DELAY) - current_time, "fm_set_user_model", taskid)

		g_ModelsTargetTime = g_ModelsTargetTime + MODELCHANGE_DELAY

	}

}



public fm_set_user_model(player)

{

	player -= MODELSET_TASK

	engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", g_PlayerModel[player])

	g_HasCustomModel[player] = true

}



stock fm_get_user_model(player, model[], len)

{

	engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)

}



stock fm_reset_user_model(player)

{

	g_HasCustomModel[player] = false

	dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))

}



public cmdMoveEnt(id)

{

	if (g_BuildBan[id] == true)

		return PLUGIN_HANDLED

	

	if (g_iszombie[id] && !access(id, AFTER_BUILD))

      		return PLUGIN_HANDLED 

			

	if (!g_CanBuild && !access(id, AFTER_BUILD))

	{

		client_print (id, print_center, "%L", LANG_SERVER, "FAIL_TIME_UP")

		return PLUGIN_HANDLED 

	}

	

	if (!g_isalive[id] && !access(id, DEAD_BUILD))

	{

		client_print (id, print_center, "%L", LANG_SERVER, "FAIL_DEAD")

		return PLUGIN_HANDLED 

	}



	if (g_pEnt[id] && is_valid_ent(g_pEnt[id])) 

		cmdStopEnt(id)

	

	new ent, bodypart

	get_user_aiming (id,ent,bodypart)

	

	if (!is_valid_ent(ent) || ent == g_iEntBarrier)

	{

		return PLUGIN_HANDLED

	}

	

	if (ent <= g_MaxPlayers && g_isalive[ent])

	{	

		return PLUGIN_HANDLED

	}

		

	if (IsBlockLocked(ent) || g_MovingEnt[ent])

	{

		return PLUGIN_HANDLED

	}



	if (get_pcvar_num(g_pcvar_claimable) == 1||get_pcvar_num(g_pcvar_claimable) == 3)

	{

		if (!g_EntOwner[ent])

		{

			if ((g_OwnedEnts[id]<get_pcvar_num(g_pcvar_maxclaimable)) || get_pcvar_num(g_pcvar_maxclaimable) == 0)

			{

				g_EntOwner[ent] = id

				g_OwnedEnts[id]++

			}

			else

			{

				client_print (id, print_center, "%L", LANG_SERVER, "FAIL_MAXOWNED", get_pcvar_num(g_pcvar_maxclaimable))

				//return PLUGIN_HANDLED 

			}

		}

		else if (g_EntOwner[ent] != id && !access(id, AFTER_BUILD))

		{

			client_print (id, print_center, "%L", LANG_SERVER, "FAIL_ALREADYOWNED")

			return PLUGIN_HANDLED 

		}

	}

	

	new tname[7], cname[10];

	entity_get_string(ent, EV_SZ_targetname, tname, 6);

	entity_get_string(ent, EV_SZ_classname, cname, 9);

	if (!equal(cname, "func_wall") || equal(tname, "ignore"))

	{

		return PLUGIN_HANDLED

	}

	

	new origin[3], entOrigin[3], Float:orig[3], Float:mins[3], Float:maxs[3], dist

	

	entity_get_vector(ent, EV_VEC_origin, orig);

	entity_get_vector(ent, EV_VEC_mins, mins);

	entity_get_vector(ent, EV_VEC_maxs, maxs);



	entOrigin[0] = floatround((mins[0] + maxs[0]) / 2 + orig[0]);

	entOrigin[1] = floatround((mins[1] + maxs[1]) / 2 + orig[1]);

	entOrigin[2] = floatround((mins[2] + maxs[2]) / 2 + orig[2]);

	

	get_user_origin(id, origin);



	dist = get_distance(origin, entOrigin);

	

	new max = get_pcvar_num(g_pcvar_entmaxdist)

	new min = get_pcvar_num(g_pcvar_entmindist)

	if (min) //min

	{

		if(dist < min) //minimum

			dist = get_pcvar_num(g_pcvar_entsetdist);

	}



	if (max) //maximum

	{

		if (dist > max)

			return PLUGIN_HANDLED

	}

	

	DispatchKeyValue(ent, "rendermode", "1");

	DispatchKeyValue(ent, "renderamt", "100");

	DispatchKeyValue(ent, "rendercolor", "120.0 219.0 226.0");



	g_MovingEnt[ent] = true

	g_EntMover[ent] = id

	g_pEnt[id] = ent

	g_pDist[id] = dist

	

	if (!g_CanBuild && access(id, AFTER_BUILD))

	{

		new adminauthid[35],adminname[35]

		get_user_authid (id,adminauthid,34)

		get_user_name(id,adminname,34)

		Log("[MOVE] Admin: %s || SteamID: %s moved an entity", adminname, adminauthid)

		client_print(0, print_chat, "Adminul %s muta piese dupa timpul de constructie.",adminname)

	}

	

	return PLUGIN_HANDLED

}



/*public fw_CmdStart(id, uc, random)

{

	new buttons = get_uc(uc, UC_Buttons)

	if(g_CanBuild && (buttons & IN_ATTACK))

	{

		buttons &= ~IN_ATTACK

		set_uc(uc, UC_Buttons, buttons)

		return FMRES_SUPERCEDE

	}

	return FMRES_IGNORED

}*/



public fw_Player_PreThink(id)

{

	if (!g_pEnt[id] || !is_valid_ent(g_pEnt[id]))

		return FMRES_HANDLED

	

	new buttons = pev(id, pev_button)

	if(buttons & IN_ATTACK)

	{

		g_pDist[id] += 3;

		

		if (g_pDist[id] > get_pcvar_num(g_pcvar_entmaxdist))

		{

			g_pDist[id] = get_pcvar_num(g_pcvar_entmaxdist)

			client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_MAX")

			return FMRES_HANDLED

		}

		else

			client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_PUSH")

	}

	else if(buttons & IN_ATTACK2)

	{

		g_pDist[id] -= 3;

			

		if (g_pDist[id] < get_pcvar_num(g_pcvar_entsetdist))

		{

			g_pDist[id] = get_pcvar_num(g_pcvar_entsetdist)

			client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_MIN")

			return FMRES_HANDLED

		}

		else

			client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_PULL")

	}

	

	GrabThink(id)

	

	return FMRES_HANDLED

}



public GrabThink(id)

{

	new origin[3], Float:aiming[3], Float:pOrigin[3], Float:mins[3], Float:maxs[3], Float:neworigin[3]

	

	if (!g_isconnected[id] || (g_pEnt[id] <= g_MaxPlayers)? !g_isconnected[id]:!is_valid_ent(g_pEnt[id]))

	{

		cmdStopEnt(id)

		return PLUGIN_HANDLED

	}

	

	entity_get_vector(g_pEnt[id], EV_VEC_mins, mins);

	entity_get_vector(g_pEnt[id], EV_VEC_maxs, maxs);

	

	get_user_origin(id, origin, 3);

	IVecFVec(origin, aiming);

	get_user_origin(id, origin);

	IVecFVec(origin, pOrigin);

	

	aiming[0] -= pOrigin[0];

	aiming[1] -= pOrigin[1];

	aiming[2] -= pOrigin[2];



	new Float:scalar = g_pDist[id] / vector_length(aiming);

	

	IVecFVec(origin, neworigin);



	neworigin[0] += aiming[0] * scalar - (mins[0] + maxs[0]) / 2.0;

	neworigin[1] += aiming[1] * scalar - (mins[1] + maxs[1]) / 2.0;

	neworigin[2] += aiming[2] * scalar - (mins[2] + maxs[2]) / 2.0;

		

	entity_set_origin(g_pEnt[id], neworigin);

	return PLUGIN_HANDLED

}



public cmdStopEnt(id)

{

	g_MovingEnt[g_pEnt[id]] = false

	DispatchKeyValue(g_pEnt[id], "rendermode", "0");

	DispatchKeyValue(g_pEnt[id], "renderamt", "255");

	DispatchKeyValue(g_pEnt[id], "rendercolor", "0.0 0.0 0.0");

	if (get_pcvar_num(g_pcvar_blockgrav) == 1)

		drop_to_floor(g_pEnt[id])

	g_EntMover[g_pEnt[id]] = 0

	g_LastMover[g_pEnt[id]] = id

	g_pEnt[id] = 0

}



public fw_Traceline(Float:start[3], Float:end[3], conditions, id, trace)

{

	if (!is_user_connected(id)) return PLUGIN_HANDLED

	

	new ent = get_tr2(trace, TR_pHit)

	

	if (pev_valid(ent))

	{

		new ent,body

		get_user_aiming(id,ent,body)

		

		new cname[10], tname[7];

		entity_get_string(ent, EV_SZ_classname, cname, 9);

		entity_get_string(ent, EV_SZ_targetname, tname, 6);

		if (equal(cname, "func_wall") && !equal(tname, "ignore") && ent != g_iEntBarrier && get_pcvar_num(g_pcvar_showmovers) == 1)

		{

			if (g_CanBuild || access(id, ADMIN_KICK))

			{

				if (IsBlockLocked(ent))

				{

					set_hudmessage(255, 0, 0, -1.0, 0.55, 1, 0.01, 3.0, 0.01, 0.01);

					ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_LOCKED");

					return PLUGIN_HANDLED

				}

				set_hudmessage(0, 50, 255, -1.0, 0.55, 1, 0.01, 3.0, 0.01, 0.01);

				if (get_pcvar_num(g_pcvar_claimable) == 3)

				{

					new currentmover[35], lastmover[35], hudmess[100], strg[56]

					if (g_LastMover[ent] && g_EntMover[ent])

					{

						get_user_name(g_EntMover[ent],currentmover,34)

						get_user_name(g_LastMover[ent],lastmover,34)

						format(strg, charsmax(strg), "%L^n", LANG_SERVER, "OBJECT_INFO3", currentmover, lastmover)

						add(hudmess, charsmax(hudmess), strg);

					}

					else if (g_EntMover[ent] && !g_LastMover[ent])

					{

						get_user_name(g_EntMover[ent],currentmover,34)

						format(strg, charsmax(strg), "%L^n", LANG_SERVER, "OBJECT_INFO1", currentmover)

						add(hudmess, charsmax(hudmess), strg);

					}

					if (g_LastMover[ent] && !g_EntMover[ent])

					{

						get_user_name(g_LastMover[ent],lastmover,34)

						format(strg, charsmax(strg), "%L^n", LANG_SERVER, "OBJECT_INFO2", lastmover)

						add(hudmess, charsmax(hudmess), strg);

					}

					else if (!g_LastMover[ent] && !g_EntMover[ent])

					{

						format(strg, charsmax(strg), "%L^n", LANG_SERVER, "OBJECT_INFO4")

						add(hudmess, charsmax(hudmess), strg);

					}

					if (g_EntOwner[ent])

					{

						new entowner[35]

						get_user_name(g_EntOwner[ent],entowner,34)

						format(strg, charsmax(strg), "%L^n", LANG_SERVER, "OBJECT_OWNER", entowner)

						add(hudmess, charsmax(hudmess), strg);

					}

					ShowSyncHudMsg(id, gHudSyncInfo, hudmess)

				}

				else if (get_pcvar_num(g_pcvar_claimable) == 0)

				{

					new currentmover[35], lastmover[35]

					if (g_EntMover[ent])

					{

						get_user_name(g_EntMover[ent],currentmover,34)

						if (!g_LastMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO1", currentmover);

					}

					if (g_LastMover[ent])

					{

						get_user_name(g_LastMover[ent],lastmover,34)

						if (!g_EntMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO2", lastmover);

					}

					if (g_LastMover[ent] && g_EntMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO3", currentmover, lastmover);

					else if (!g_LastMover[ent] && !g_EntMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO4");

				}

				else

				{

					if (g_EntOwner[ent])

					{

						new entowner[35]

						get_user_name(g_EntOwner[ent],entowner,34)

						ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_OWNER", entowner);

					}

					else 

					{

						ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_OWNER_NONE");

					}

				}

			}

		}

	}

	if (!pev_valid(ent)) ClearSyncHud(id, gHudSyncInfo);

	

	return PLUGIN_HANDLED

}



public cmdLockBlock(id)

{

	if (!access(id, LOCK_BLOCKS))

		return PLUGIN_HANDLED

		

	new ent, bodypart

	get_user_aiming (id,ent,bodypart)

	

	new tname[7], cname[10];

	entity_get_string(ent, EV_SZ_targetname, tname, 6);

	entity_get_string(ent, EV_SZ_classname, cname, 9);



	if (!ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname, "func_wall") || equal(tname, "ignore")) return PLUGIN_HANDLED

	

	if (!IsBlockLocked(ent) && !g_MovingEnt[ent])

	{

		LockBlock(ent)

		DispatchKeyValue(ent, "rendermode", "1");

		DispatchKeyValue(ent, "rendercolor", "125.0 0.0 0.0");

		

		g_OwnedEnts[g_EntOwner[ent]]--

		g_EntOwner[ent] = 0

	}

	else if (IsBlockLocked(ent))

	{

		UnlockBlock(ent)

		DispatchKeyValue(ent, "rendermode", "0");

	}

	return PLUGIN_HANDLED

}



public cmdRemoveClaim(id)

{

	if (!access(id, LOCK_BLOCKS))

      		return PLUGIN_HANDLED 

		

	new ent, bodypart

	get_user_aiming (id,ent,bodypart)

	

	new tname[7], cname[10];

	entity_get_string(ent, EV_SZ_targetname, tname, 6);

	entity_get_string(ent, EV_SZ_classname, cname, 9);



	if (!ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname, "func_wall") || equal(tname, "ignore") || IsBlockLocked(ent)) return PLUGIN_HANDLED



	g_OwnedEnts[g_EntOwner[ent]]--

	g_EntOwner[ent] = 0

	

	return PLUGIN_HANDLED

}



public cmdRemoveEnt(id)

{

	if (!access(id, REMOVE_BLOCK))

      		return PLUGIN_HANDLED 



	if (!g_isalive[id] && !access(id, DEAD_REMOVE))

	{

		client_print (id, print_center, "%L", LANG_SERVER, "FAIL_REMOVE")

		return PLUGIN_HANDLED 

	}

      	

	new ent, bodypart

	get_user_aiming (id,ent,bodypart)

	

	if(!is_valid_ent(ent) || ent == g_iEntBarrier || (ent <= g_MaxPlayers && g_isalive[ent]))

		return PLUGIN_HANDLED

	

	if(IsBlockLocked(ent) || g_MovingEnt[ent])

		return PLUGIN_HANDLED



	new tname[7], cname[10];

	entity_get_string(ent, EV_SZ_targetname, tname, 6);

	entity_get_string(ent, EV_SZ_classname, cname, 9);

	if(!equal(cname, "func_wall"))

		return PLUGIN_HANDLED

	

	if(equal(tname, "ignore"))

		return PLUGIN_HANDLED

		

	g_OwnedEnts[g_EntOwner[ent]]--

	g_EntOwner[ent] = 0

	

	remove_entity(ent)

	

	new adminauthid[35],adminname[35]

	get_user_authid (id,adminauthid,34)

	get_user_name(id,adminname,34)

	Log("[REMOVE] Admin: %s || SteamID: %s removed an entity", adminname, adminauthid)

	

	return PLUGIN_HANDLED

}



// Ham Weapon Deploy Forward (forces knife only)

public ham_ItemDeploy_Post(weapon_ent)

{

	static owner

	owner = get_pdata_cbase(weapon_ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS);

	

	static weaponid

	weaponid = cs_get_weapon_id(weapon_ent)

	

	g_CurrentWeapon[owner] = weaponid

	

	if (g_iszombie[owner] && !((1<<weaponid) & ZOMBIE_ALLOWED_WEAPONS_BITSUM))

	{

		g_CurrentWeapon[owner] = CSW_KNIFE

		engclient_cmd(owner, "weapon_knife")

	}

	else if (g_CanBuild && g_ishuman[owner])

	{

		g_CurrentWeapon[owner] = CSW_KNIFE

		engclient_cmd(owner, "weapon_knife")

		client_print(owner, print_center, "%L", LANG_SERVER, "FAIL_KNIFE_ONLY");

	}

}



public msgRoundEnd(const MsgId, const MsgDest, const MsgEntity)

{

	static Message[192]

	get_msg_arg_string(2, Message, 191)

	

	set_hudmessage(255, 255, 255, -1.0, 0.40, 0, 6.0, 6.0, 0.1, 0.2, 1)

	

	if(equal(Message, "#Game_bomb_drop"))

		return PLUGIN_HANDLED

	

	if (equal(Message, "#Terrorists_Win"))

	{

		show_hudmessage(0, "Zombies Win!")

		set_msg_arg_string(2, "")

		switch (random_num(1, 4))

		{

			case 1: client_cmd(0, "spk ambience/the_horror1.wav")

			case 2: client_cmd(0, "spk ambience/the_horror2.wav")

			case 3: client_cmd(0, "spk ambience/the_horror3.wav")

			case 4: client_cmd(0, "spk ambience/the_horror4.wav")

		}

		return PLUGIN_HANDLED

	}

	else if (equal(Message, "#Target_Saved") || equal(Message, "#CTs_Win"))

	{

		show_hudmessage(0, "Builders Win!")

		set_msg_arg_string(2, "")

		switch (random_num(1, 3))

		{

			case 1: client_cmd(0, "spk barney/ba_another.wav")

			case 2: client_cmd(0, "spk barney/ba_firepl.wav")

			case 3: client_cmd(0, "spk barney/ba_seethat.wav")

		}

		return PLUGIN_HANDLED

	}

	return PLUGIN_HANDLED

}



public ham_WeaponCleaner_Post(iEntity)

{

	call_think(iEntity)

}

public message_show_menu(msgid, dest, id) 

{

	if (!should_autojoin(id))

		return PLUGIN_CONTINUE



	static team_select[] = "#Team_Select"

	static menu_text_code[sizeof team_select]

	get_msg_arg_string(4, menu_text_code, sizeof menu_text_code - 1)

	if (!equal(menu_text_code, team_select))

		return PLUGIN_CONTINUE



	set_force_team_join_task(id, msgid)



	return PLUGIN_HANDLED

}



public message_vgui_menu(msgid, dest, id) 

{

	if (get_msg_arg_int(1) != TEAM_SELECT_VGUI_MENU_ID || !should_autojoin(id))

		return PLUGIN_CONTINUE

		

	set_force_team_join_task(id, msgid)



	return PLUGIN_HANDLED

}



bool:should_autojoin(id) 

{

	return (!get_user_team(id))

}



set_force_team_join_task(id, menu_msgid) 

{

	static param_menu_msgid[2]

	param_menu_msgid[0] = menu_msgid

	set_task(AUTO_TEAM_JOIN_DELAY, "task_force_team_join", id, param_menu_msgid, sizeof param_menu_msgid)

}



public task_force_team_join(menu_msgid[], id) 

{

	if (get_user_team(id))

		return



	static team[2], class[2]

	get_pcvar_string(g_pcvar_team, team, sizeof team - 1)

	get_pcvar_string(g_pcvar_class, class, sizeof class - 1)

	force_team_join(id, menu_msgid[0], team, class)

}



stock force_team_join(id, menu_msgid, /* const */ team[] = "5", /* const */ class[] = "0") 

{

	static jointeam[] = "jointeam"

	if (class[0] == '0') {

		engclient_cmd(id, jointeam, team)

		return

	}



	static msg_block, joinclass[] = "joinclass"

	msg_block = get_msg_block(menu_msgid)

	set_msg_block(menu_msgid, BLOCK_SET)

	engclient_cmd(id, jointeam, team)

	engclient_cmd(id, joinclass, class)

	set_msg_block(menu_msgid, msg_block)

}



public clcmd_changeteam(id)

{

	if (g_CanBuild) 

		weapon_method_menu(id)

	else 

		client_print (id, print_center, "%L", LANG_SERVER, "FAIL_WEAPONS")

	

	if (g_iszombie[id])

		client_print (id, print_center, "%L", LANG_SERVER, "FAIL_ZOMBIE")

		

	return PLUGIN_HANDLED

}



public clcmd_drop(id)

{

	client_print (id, print_center, "%L", LANG_SERVER, "FAIL_DROP")

	return PLUGIN_HANDLED

}



public clcmd_buy(id)

{

	client_print (id, print_center, "%L", LANG_SERVER, "FAIL_BUY")

	return PLUGIN_HANDLED

}



public fw_Suicide(id)

{

	client_print (id, print_center, "%L", LANG_SERVER, "FAIL_SUICIDE")

	console_print (id, "%L", LANG_SERVER, "FAIL_SUICIDE")

	return FMRES_SUPERCEDE;

}



public Base_Calc()

{

	new players[32], num, ct, basenum

	get_players(players, num)

	new player

	for(new i = 0; i < num; i++)

	{

		player = players[i]

		if (cs_get_user_team(player) == CS_TEAM_CT)

			ct++



		if (ct < 6)

			basenum = 2

		else

			basenum = (ct/3)

	}

	print_color(0, "%s %L", formatmodname, LANG_SERVER, "BASE_CALC", basenum)

}



public cmdBadSpawn_Survivor(id)

{

	if (access(id, BAD_SPAWN))

	{

		new players[32], num

		get_players(players, num)

			

		new player

		for(new i = 0; i < num; i++)

		{

			player = players[i]

			if (cs_get_user_team(player) == CS_TEAM_CT && !is_user_alive(player) && g_isconnected[player] && g_CanBuild)

				ExecuteHamB(Ham_CS_RoundRespawn, player)

		}

	}

}



public Fix_Spawns()

{

	new players[32], num

	get_players(players, num)

			

	new player

	for(new i = 0; i < num; i++)

	{

		player = players[i]

		if (cs_get_user_team(player) == CS_TEAM_CT && !is_user_alive(player) && g_isconnected[player] && g_CanBuild)

			ExecuteHamB(Ham_CS_RoundRespawn, player)

	}

}



public cmdBadSpawn(id)

{

	if (g_isconnected[id] && g_ishuman[id] && g_CanBuild)

		ExecuteHamB(Ham_CS_RoundRespawn, id)

}



public cmdBadSpawn_Zombie(id)

{

	if (access(id, BAD_SPAWN))

	{

		new players[32], num

		get_players(players, num)

			

		new player

		for(new i = 0; i < num; i++)

		{

			player = players[i]

			if (cs_get_user_team(player) == CS_TEAM_T && !is_user_alive(player) && g_isconnected[player])

				ExecuteHamB(Ham_CS_RoundRespawn, player)

		}

	}

}



public msgStatusIcon(const iMsgId, const iMsgDest, const iPlayer)

{

	if(is_user_alive(iPlayer)) 

	{

		static szMsg[8]

		get_msg_arg_string(2, szMsg, 7)

    

		if(equal(szMsg, "buyzone"))

		{

			set_pdata_int(iPlayer, OFFSET_BUYZONE, get_pdata_int(iPlayer, OFFSET_BUYZONE) & ~(1<<0))

			return PLUGIN_HANDLED

		}

	}

	return PLUGIN_CONTINUE

}



public cmdBuildBan(id)

{

	if (access(id, BUILD_BAN))

	{

		new arg[32]

		read_argv(1, arg, 31)

		new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY)

		g_BuildBan[player] = true

		cmdStopEnt(player)

		

		new adminauthid[35],adminname[35],playername[35],playerauthid[35]

		get_user_name(id,adminname,34)

		get_user_authid (id,adminauthid,34)

		get_user_name(player, playername, 34)

		get_user_authid (player,playerauthid,34)

		Log("[MOVE] Admin: %s || SteamID: %s banned Player: %s || SteamID: %s from building", adminname, adminauthid, playername, playerauthid)

		

		client_print(id, print_console, "%L", LANG_SERVER, "BUILD_BAN1", playername)

		client_print(player, print_center, "%L", LANG_SERVER, "BUILD_BAN2")

	}

}



public cmdBuildUnban(id)

{

	if (access(id, BUILD_BAN))

	{

		new arg[32], playername[35]

	

		read_argv(1, arg, 31)

		new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY)

		get_user_name(player, playername, 34)

		client_print(id, print_console, "%L", LANG_SERVER, "UNBUILD_BAN1", playername)

		g_BuildBan[player] = false

		print_color(player, "%s %L", formatmodname, LANG_SERVER, "UNBUILD_BAN2")

	}

}



public cmdRevive(id)

{

	if (access(id, REVIVE))

	{

		new arg[32]

		read_argv(1, arg, 31)

		new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY)



		if (is_user_alive(player))

		{

			client_print(id, print_console, "%L", LANG_SERVER, "FAIL_REVIVE")

			return PLUGIN_HANDLED

		}

		

		ExecuteHamB(Ham_CS_RoundRespawn, player)

		

		new adminauthid[35],adminname[35],playername[35],playerauthid[35]

		get_user_name(id,adminname,34)

		get_user_authid (id,adminauthid,34)

		get_user_name(player, playername, 34)

		get_user_authid (player,playerauthid,34)

		Log("[REVIVE] Admin: %s || SteamID: %s revived Player: %s || SteamID: %s", adminname, adminauthid, playername, playerauthid)

		

		client_print(id, print_console, "%L", LANG_SERVER, "REVIVE1", playername)

		client_print(player, print_center, "%L", LANG_SERVER, "REVIVE2")

	}

	return PLUGIN_HANDLED

}



public cmdSwap(id)

{

	if (access(id, SWAP))

	{

		new arg[32]

		read_argv(1, arg, 31)

		new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY)



		if (!is_user_connected(player)) return PLUGIN_HANDLED

		

		cs_set_user_team(player, cs_get_user_team(player) == CS_TEAM_T ? CS_TEAM_CT:CS_TEAM_T)

			

		if (cs_get_user_team(player) == CS_TEAM_T)

		{

			g_iszombie[player] = true

			g_ishuman[player] = false

		}

		if (cs_get_user_team(player) == CS_TEAM_CT)

		{

			g_ishuman[player] = true

			g_iszombie[player] = false

		}

		

		if (is_user_alive(player))

			ExecuteHamB(Ham_CS_RoundRespawn, player)

		

		new adminauthid[35],adminname[35],playername[35],playerauthid[35]

		get_user_name(id,adminname,34)

		get_user_authid (id,adminauthid,34)

		get_user_name(player, playername, 34)

		get_user_authid (player,playerauthid,34)

		Log("[TEAM-SWAP] Admin: %s || SteamID: %s swapped Player: %s || SteamID: %s", adminname, adminauthid, playername, playerauthid)

		

		client_print(id, print_console, "%L", LANG_SERVER, "SWAP1", playername)

		client_print(player, print_center, "%L", LANG_SERVER, "SWAP2")

	}

	return PLUGIN_HANDLED

}



public cmdStartRound(id)

{

	if (access(id, START_ROUND))

	{

		if (count_down<10)

		{

			client_print(id, print_console, "%L", LANG_SERVER, "FAIL_START_ROUND")

			return PLUGIN_HANDLED

		}

		g_CanBuild = false

		Release_Zombies()

		

		new adminauthid[35],adminname[35]

		get_user_name(id,adminname,34)

		get_user_authid (id,adminauthid,34)

		Log("[START_ROUND] Admin: %s || SteamID: %s started the round", adminname, adminauthid)

		

		client_print(id, print_center, "%L", LANG_SERVER, "START_ROUND")

		client_print(id, print_chat, "^x04%L", LANG_SERVER, "START_ROUND")

	}

	return PLUGIN_HANDLED

}



public cmdCheckRound(id)

{

	if (g_ZombiesReleased) print_color(id, "%s Runda: %d of %d", formatmodname, (g_RoundNum), g_pcvar_maxrounds)

	else if (!g_ZombiesReleased) print_color(id, "%s Runda: %d of %d", formatmodname, (g_RoundNum+1), g_pcvar_maxrounds)

}



public msgStatusValue()

{

	//Block the name info, of person you aim at

	set_msg_block(gmsgStatusText, BLOCK_SET);

}



public ev_SetTeam(id)

{

	g_friend[id] = read_data(2)

}



public ev_ShowStatus(id) //called when id looks at someone

{

	new name[32], pid = read_data(2);

	new stats[8],bodyhits[8]

	

	get_user_name(pid, name, 31);

	new color1 = 0, color2 = 0;



	if (get_user_team(pid) == 1)

		color1 = 255;

	else

		color2 = 255;



	new Float:height=0.35

	//height=0.60



	if (g_friend[id] == 1)	// friend

	{

		new clip, ammo, wpnid = get_user_weapon(pid, clip, ammo);

		new wpnname[32];



		if (wpnid)

			xmod_get_wpnname(wpnid, wpnname, 31);



		new rank = get_user_stats(pid, stats, bodyhits)

		set_hudmessage(color1, 50, color2, -1.0, height, 1, 0.01, 3.0, 0.01, 0.01);

		ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "PLAYER_INFO1", name, rank, get_user_health(pid), wpnname);

	} 

	if (g_friend[id] != 1) //enemy

	{

		new rank = get_user_stats(pid, stats, bodyhits)

		set_hudmessage(color1, 50, color2, -1.0, height, 1, 0.01, 3.0, 0.01, 0.01);

		ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "PLAYER_INFO2", name, rank);

	}

}



public ev_HideStatus(id)

{

	ClearSyncHud(id, gHudSyncInfo);

}



public weapon_method_menu(id)

{

	if(firsttime[id])

	{

		firsttime[id] = false

		prim_weapons_menu(id,0)

	}

	else

	{

		cur_offset[id] = 0

		if(ask[id])

		{

			show_menu(id,(1<<0)|(1<<1)|(1<<2),"Metode de selectie a armelor^n^n1. Arme noi^n2. Arme precedente^n3. Arme precedente definitiv",-1,"WeaponMethodMenu")

		}

		else

		{

			give_weapons(id)

		}

	}

}



public weapon_method_pushed(id,key)

{

	switch(key)

	{

		case 0:

		{

			ask[id] = true

			prim_weapons_menu(id,0)

		}	

		case 1:

		{

			ask[id] = true

			give_weapons(id)

		}

		case 2:

		{

			print_color(id, "%s %L", formatmodname, LANG_SERVER, "GUNS_MSG")

			ask[id] = false

			give_weapons(id)

		}

	}

	return PLUGIN_HANDLED;

}



public prim_weapons_menu(id,offset)

{

	if(offset<0) offset = 0



	new cvar_value[32]

	get_pcvar_string(g_pcvar_allowedweps,cvar_value,31)

	new flags = read_flags(cvar_value)



	new keys, curnum, menu[2048]

	for(new i=offset;i<19;i++)

	{

		if(flags & power(2,i))

		{

			options_on_menu[curnum][id] = i

			keys += (1<<curnum)

	

			curnum++

			format(menu,2047,"%s^n%d. %s",menu,curnum,WEAPONNAMES[i])

	

			if(curnum==8)

			break;

		}

	}



	format(menu,2047,"\yPrimary Weapon:\w^n%s^n",menu)

	if(curnum==8 && offset<12)

	{

		keys += (1<<8)

		format(menu,2047,"%s^n9. Next",menu)

	}

	if(offset)

	{

		keys += (1<<9)

		format(menu,2047,"%s^n0. Back",menu)

	}



	show_menu(id,keys,menu,-1,"PrimaryWeaponSelect")

}



public prim_weapons_pushed(id,key)

{

	if(key<8)

	{

		weapon_picked[0][id] = options_on_menu[key][id]

		cur_offset[id] = 0

		sec_weapons_menu(id,0)

	}

	else

	{

		if(key==8)

			cur_offset[id] += 8

		if(key==9)

			cur_offset[id] -= 8

		prim_weapons_menu(id,cur_offset[id])

	}

	return ;

}



public sec_weapons_menu(id,offset)

{

	if(offset<0) offset = 0



	new cvar_value[32]

	get_pcvar_string(g_pcvar_allowedweps,cvar_value,31)

	new flags = read_flags(cvar_value)



	new keys, curnum, menu[2048]

	for(new i=18;i<24;i++)

	{

		if(flags & power(2,i))

		{

		options_on_menu[curnum][id] = i

		keys += (1<<curnum)



		curnum++

		format(menu,2047,"%s^n%d. %s",menu,curnum,WEAPONNAMES[i])

		}

	}



	format(menu,2047,"\ySecondary Weapon:\w^n%s",menu)



	show_menu(id,keys,menu,-1,"SecWeaponSelect")

}



public sec_weapons_pushed(id,key)

{

	if(key<8)

	{

		weapon_picked[1][id] = options_on_menu[key][id]

	}

	give_weapons(id)

	return ;

}



public give_weapons(id)

{

	strip_user_weapons(id)



	give_item(id,"weapon_knife")

   

	new weapon[32]

	new csw = csw_contant(weapon_picked[0][id])

	get_weaponname(csw,weapon,31)

	give_item(id,weapon)

	cs_set_user_bpammo(id,csw,999)

	g_PrimaryWeapon[id] = csw



	csw = csw_contant(weapon_picked[1][id])

	get_weaponname(csw,weapon,31)

	give_item(id,weapon)

	cs_set_user_bpammo(id,csw,999)

}



public csw_contant(weapon)

{

	new num = 29

	switch(weapon)

	{

		case 0: num = 3

		case 1: num = 5

		case 2: num = 7

		case 3: num = 8

		case 4: num = 12

		case 5: num = 13

		case 6: num = 14

		case 7: num = 15

		case 8: num = 18

		case 9: num = 19

		case 10: num = 20

		case 11: num = 21

		case 12: num = 22

		case 13: num = 23

		case 14: num = 24

		case 15: num = 27

		case 16: num = 28

		case 17: num = 30

		case 18: num = 1

		case 19: num = 10

		case 20: num = 11

		case 21: num = 16

		case 22: num = 17

		case 23: num = 26

		case 24:

		{

			new s_weapon[32]

		

			get_pcvar_string(g_pcvar_allowedweps,s_weapon,31)

		   

			new flags = read_flags(s_weapon)

			do

			{

				num = random_num(0,18)

				if(!(num & flags))

				{

					num = -1

				}

			}

			while(num==-1)

			num = csw_contant(num)

		}

		case 25:

		{

			new s_weapon[32]



			get_pcvar_string(g_pcvar_allowedweps,s_weapon,31)

		

			new flags = read_flags(s_weapon)

			do

			{

				num = random_num(18,23)

				if(!(num & flags))

				{

					num = -1

				}

			}

			while(num==-1)

			num = csw_contant(num)

		}

	}

	return num;

}





public cmdGuns(id)

{

	if(!g_isalive[id] || !g_isconnected[id] || !g_CanBuild)

		return PLUGIN_HANDLED

	

	if(!g_ishuman[id])

		return PLUGIN_HANDLED	



	ask[id] = true

	weapon_method_menu(id)

	return PLUGIN_HANDLED

}



public ev_Health(id)

{

	ShowHealth(id);

}



public ShowHealth(id)

{

	if (is_user_alive(id))

	{

		new Float:hud_time = get_pcvar_float(g_pcvar_healthtime);

		

		set_hudmessage(255, 255, 255, -1.0, 0.9, 0, hud_time, hud_time, 0.1, 0.2, 4);

		show_hudmessage(id, "%L", LANG_SERVER, "PLAYER_HEALTH", get_user_health(id));

		

		set_task(hud_time - 0.1, "ShowHealth", id);

	}

}

public unhelp(id)

{

	if (access(id, ACCES_HELP))

	{

		new arg[32]

		read_argv(1, arg, charsmax(arg))

		new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY)

		if(!is_user_connected(player))

		{

			console_print(id, "Playerul scris nu este conectat pe server")

			return PLUGIN_HANDLED

		}

		if(!needhelp[player])

		{

			console_print(id, "Playerul scris nu are solicitat cerere de ajutor")

			return PLUGIN_HANDLED

		}



		new playername[35],adminname[35]

		get_user_name(id,adminname,34)

		get_user_name(player,playername,34)

		Log("[UNHELP] Admin: %s || Player: %s", adminname, playername)

		

		print_color(0, "^x04[BBx.PlayArena.Ro]^x01 Adminul ^x03%s^x01 a scos cererea de ajutor a lui ^x03%s",adminname,playername)

		needhelp[player] = 0

		for(new i; i < 32;i++)

			if(task_exists(i+500))

				remove_task(i+500)

	}

	return PLUGIN_HANDLED

}

public say_help(id)

{

	if(is_user_alive(id))

	{

		if(needhelp[id])

			print_color(id, "^x04[BBx.PlayArena.Ro]^x01 Deja ai o cerere de ajutor, asteapta")

		else if(access(id, ACCES_HELP))

			print_color(id, "^x04[BBx.PlayArena.Ro]^x01 Esti admin, nu poti folosi /help")

		else

		{

			new countadmin, stringAdmin[55], adminName[32], playerName[32]

			needhelp[id] = 1

			get_user_name(id, playerName, charsmax(playerName))

			for(new i; i < 32;i++)

			{

				if(is_user_alive(i) && access(i, ACCES_HELP))

				{

					get_user_name(i, adminName, charsmax(adminName))

					if(!task_exists(i+500))

						set_task(2.0, "ShowRadars", i+500, _, _, "b");



					print_color(i, "^x04Playerul ^x03%s ^x04a facut o cerere de ajutor!",playerName)

					print_color(i, "^x04Vei primi imediat coordonatele pe radar")

					countadmin++

					if(countadmin == 1)

						format(stringAdmin, charsmax(stringAdmin), "^x04 Admin(s) ^x03%s", adminName)

					else if(countadmin < 4)

						format(stringAdmin, charsmax(stringAdmin), "%s,%s", stringAdmin,adminName)

				}

			}

			if(countadmin < 4)

				format(stringAdmin, charsmax(stringAdmin), "x04[BBx.PlayArena.Ro]^x01 Au primit cererea de ajutor", stringAdmin,adminName)

			else

				format(stringAdmin, charsmax(stringAdmin), "^x03%i^x04 admini au primit informare la cererea de ajutor",countadmin)



			print_color(id, stringAdmin)

		}

	}

	else if(is_user_connected(id))

		print_color(id, "^x04[BBx.PlayArena.Ro] ^x01Ca sa ceri ajutor trebuie sa fi in viata")

}

Log(const message_fmt[], any:...)

{

	static message[256];

	vformat(message, sizeof(message) - 1, message_fmt, 2);

	

	static filename[96];

	static dir[64];

	if( !dir[0] )

	{

		get_basedir(dir, sizeof(dir) - 1);

		add(dir, sizeof(dir) - 1, "/logs");

	}

	

	format_time(filename, sizeof(filename) - 1, "%m-%d-%Y");

	format(filename, sizeof(filename) - 1, "%s/BB_ACTIVITY_%s.log", dir, filename);

	

	log_to_file(filename, "%s", message);

}

public ShowRadars(id)

{

	id -= 500

	for(new i;i < 32;i++)

	{

		if(is_user_connected(id) && is_user_connected(i) && id != i && needhelp[i])

		{

			pev(i, pev_origin, fOrigin)

			ShowRadar(id, i)

		}

	}

} 

ShowRadar(id, help)

{

	message_begin( MSG_ONE_UNRELIABLE, g_iMsgIdHostagePos, {0,0,0}, id );

	write_byte( id );

	write_byte( help );

	engfunc(EngFunc_WriteCoord, fOrigin[0]);

	engfunc(EngFunc_WriteCoord, fOrigin[1]);

	engfunc(EngFunc_WriteCoord, fOrigin[2]);

	message_end( );



	message_begin( MSG_ONE_UNRELIABLE, g_iMsgIdHostageK, {0,0,0}, id );

	write_byte( help );

	message_end( );

} 

print_color(target, const message[], any:...)

{

	static buffer[512], i, argscount

	argscount = numargs()

	

	// Send to everyone

	if (!target)

	{

		static player

		for (player = 1; player <= g_MaxPlayers; player++)

		{

			if (!g_isconnected[player])

				continue;



			static changed[5], changedcount

			changedcount = 0



			for (i = 2; i < argscount; i++)

			{

				if (getarg(i) == LANG_PLAYER)

				{

					setarg(i, 0, player)

					changed[changedcount] = i

					changedcount++

				}

			}

			vformat(buffer, charsmax(buffer), message, 3)



			message_begin(MSG_ONE_UNRELIABLE, gmsgSayText, _, player)

			write_byte(player)

			write_string(buffer)

			message_end()

			

			for (i = 0; i < changedcount; i++)

				setarg(changed[i], 0, LANG_PLAYER)

		}

	}

	// Send to specific target

	else

	{

		vformat(buffer, charsmax(buffer), message, 3)



		message_begin(MSG_ONE, gmsgSayText, _, target)

		write_byte(target)

		write_string(buffer)

		message_end()

	}

}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1030\\ f0\\ fs16 \n\\ par }

*/

Last edited by Ykaru; 08-11-2019 at 09:11.
Ykaru is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-11-2019 , 09:10   Re: Move Ct to zm
Reply With Quote #2

Use BB 6.5
__________________
edon1337 is online now
Send a message via Skype™ to edon1337
Reply


Thread Tools
Display Modes

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

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

Forum Jump


All times are GMT -4. The time now is 19:43.


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