AdminMod.de
https://www.adminmod.de/

Chicken mod und statsme - bei TK Option "Huhn" anb
https://www.adminmod.de/viewtopic.php?t=3695
Seite 1 von 1

Autor:  Cuugan1 [ 23.07.2002, 11:58 ]
Betreff des Beitrags:  Chicken mod und statsme - bei TK Option "Huhn" anb

Hallo Leute,

wo und was genau muss ich ändern, wenn ich nach einem TK nicht nur vergeben, slap, oder aussetzen (standart) anbieten möchte, sondern auch die verwandlung in ein huhn?
Chickenmod hab ich, aber ich weiss nicht wie ich es in statsme implementieren kann.

System: Win XP prof, adminmod, metamod, statsme

Autor:  Tradikey [ 23.07.2002, 13:13 ]
Betreff des Beitrags: 

Das wollte ich auch gerne machen, doch niemand scheint zu wissen, wie es machbar ist. Ich war schon auf einem Server, wo es so etwas schon gab. Zur Strafe eine Runde lang Huhn und danach wieder normal. :)

Autor:  =[mB]= Legionaer [ 23.07.2002, 15:52 ]
Betreff des Beitrags: 

So etwas gibt es nicht in StatsMe, aber es gibt sehr viele plugins für am unmd logd die sowas oder sowas ähnliches bieten oder wo man es leicht umschreiben kann. Dass der spieler aber wieder zurückverwandelt wird nach ner zeit.. kenn ich nicht aber wäre gut :)

Autor:  [SMD]Infinity [ 24.07.2002, 01:29 ]
Betreff des Beitrags: 

So was gibt es aber bei Chickenmod! Hatte das auch mal drauf aber so richtig funzt hat es nie

Autor:  Tradikey [ 26.07.2002, 00:01 ]
Betreff des Beitrags: 

Ich habe endlich einen Server gefunden, wo irgendein Servertool diese TK-Punish Variante anbietet. Das ist einfach nur genial, nur leider habe ich keine Ahnung wie es heißt und wo man es runterladen kann. Ich poste hie rmal die Server-IP und vielleicht kann hier ja jemand mal connecten und mir sagen was es ist und wo ich es herbekomme! :)

Server:

[M.A.D]Kuechenschrank

IP: 141.44.164.81:27015

Autor:  [SMD]Infinity [ 26.07.2002, 10:24 ]
Betreff des Beitrags: 

Oh ja den Server kenne ich. Da habe ich früher oft gezockt, aber die Leute dort brauchste echt nicht fragen wenn du was wissen willst. Ich habe 3mal ne E-mail dorthin geschickt weil ich wissen wollte was die dort für ein Plugin am laufen haben. Ich weiß zwar jetzt das es um Statsme ging aber ich bekam von dort nie eine Antwort!

Autor:  Tradikey [ 26.07.2002, 13:03 ]
Betreff des Beitrags: 

Ich habe gestern ne Mail an den Clanleader geschickt und promt lag heute Morgen eine "RE" in meinem Postfach. Ich weiß jetzt welches Plugin es ist und wo man es bekommt (www.olo.counter-strike.pl , da das "atac" Plugin). Ich werde es heute mal testen... :)

Autor:  Tradikey [ 26.07.2002, 14:03 ]
Betreff des Beitrags: 

Also ich habe jetzt das Plugin ausprobiert und nun möchte ich nurnoch eine Sache ändern, und zwar das man nicht gekickt und gebannt wird. Es wäre nett wenn mir jemand zeigen könnte, wo ich das ausstellen kann.

Hier die SMA:
Code:
/***************************************************************************
* Advanced Team Attack Control [ATAC] AM Plugin for use with StatsMe (v2.6.2 or higher) MetaMod plugin and Counter-Strike 1.5.
* First Rekease Date: Apr 2002
* Written/Developed by: F117Bomb & [DsV]T(+)rget
* Special Thanks to: PsychoGuard and OLO.
* Contact: TheJew@socal.rr.com or target@dreamscapevirus.com
* Lines of Code: 1000+ 
* FOR ADDITIONAL HELP THE FORUMS ARE HERE: http://forums.unitedadmins.com/forumdisplay.php?s=&forumid=36
*
* ADMIN COMMANDS:
*	admin_atac_tac: Toggles Team Attack Control ON and OFF.
*	admin_atac_tarsc: Toggles Team Attack Round Start Control ON and OFF.
*	admin_atac_ta_slay: Toggles Team Attack Limit slaying ON and OFF.
*	admin_atac_ta_slap: Toggles Team Attack Slapping ON and OFF.
*	admin_atac_tkc: Toggles TK Control ON and OFF.
*	admin_atac_ta_naf <#>: Sets taNotAllowedFor in seconds (0=OFF)		
*
* SAY COMMANDS:
*	/tastatus - Shows how many TEAM ATTACK Warnings you have.
*	/tkstatus - Show how many Team Kill Violations you have.
*	/whotkedme - Shows all players that have TKed you.
*
* EXPLANATION:
*	TK CONTROL:
*		1. When a player gets TKed menu comes up and displays his revenge options. 
*		2. Unless forgiven the Killers Team Kill Count Increases by one.
*	TA CONTROL:
*		1. If player TA's within 'taNotAllowedFor' secs of new round his is slayed.
*		2. If player TA's after 'taNotAllowedFor' his TA count is increase by one. 
*		3. When player has reached the max. allowable TA's for a specific round his  
*		   Team Kill Count Increase by one and if SlayOnMaxTAs is on 
*		   then the player is slayed.  
*	TEAM ATTACK VIOLATION:
*		1. When a play has reached the max Team Kill Violations he is banned for 
*		   'banTime' min. 
*
* REQUIRED: 
*	STATSME - http://www.olo.counter-strike.pl/index.php?page=files	
*	ADMINMOD - http://www.adminmod.org
*	COUNTER-STRIKE SERVER - (if you dont have this one your in trouble)
*
***************************************************************************/ 
#pragma dynamic 32768
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>

#define ACCESS_CONSOLE 131072
#define ACCESS_ATAC 131071
#define ACCESS_IMMUNE 2048
#define ON 1
#define OFF 0
#define YES 1
#define NO 0
#define CT 2
#define T 1
#define IP 1
#define WON_ID 2

//**********************************Menu Variables***************************************************
//IF BOTH JAIL AND CHICKEN OPTIONS ARE ON SLAY NEXROUND OPTION GOES AWAY
// Enables the menu options on the menu. (OFF or ON)
new option_slap = ON;
new option_slay = ON;
new option_slay_nr = ON;
new option_jail = ON;
	new JailTime = 30; // Set the amount of time you want the user jailed for in seconds. 
new option_chicken = ON;
new option_bury = ON;
new option_glow = ON;
new option_bomb = ON;
	new explosion_affects_player = OFF; //When player explodes will his explosion kill others? 
	new explosion_range = 400; //How far away will his explosion kill others? 
	
//********************************** Team Kill Violation Variables **********************************
// Set amount of time(minutes) you want to ban a user after their Teamattack Violations have hit the 
// limit. (0 = Permanent Ban) 
new banTime = 1;
	//Set to IP or WON_ID
	new BanVia = WON_ID;
	
// Set Number of Teamattack Violations you want allowed before user is banned. 
new TK_before_ban = 6;

//********************************** TA Variables ***************************************************
// Turns on and off TEAM ATTACK Control. (OFF or ON)
// NOTE: Can be changed in game.
new TAControl = ON; 

// Amount of time(seconds) after round start that team attackers are slayed. (0=OFF or OFF=OFF) NOTE: Can be changed in game. 
new taNotAllowedFor = 5;

// Sets Instant slaying when MAX team attacks are reached ON or OFF. (OFF or ON)
// NOTE: Can be changed in game.
new SlayOnMaxTAs = OFF;

// Set Slapping ON or OFF when someone TA's. (OFF or ON)
// NOTE: Can be changed in game.
new ta_slap = OFF;

// Set Number of TA's you want to be counted as a TK Violation. (can NOT be higher than 9) 
new TA_EQUAL_V = 9;

//********************************** TK Variables ***************************************************
// Turns on and off TA Control. (OFF or ON)
// NOTE: Can be changed in game.
new TKControl = ON; 

//Set to how many times you want a Victim to be able to slap his/her TKer. 
new tk_slaps = 8; 

//Do you want admins to be immune to the punishment? 
new admins_immune = NO;

//********************************** OTHER **********************************************************
// Heres where you can change the say formats; be carefull. 
new set_ttd[MAX_DATA_LENGTH] = "sm_sayformat 140=0=0=0.75=0.50=2=0.02=5=0.01=0.1=3";
new set_cttd[MAX_DATA_LENGTH] = "sm_sayformat 0=100=200=0.75=0.50=2=0.02=5=0.01=0.1=3";
new set_ttk[MAX_DATA_LENGTH] = "sm_sayformat 140=0=0=0.05=0.50=2=0.02=5=0.01=0.1=4";
new set_cttk[MAX_DATA_LENGTH] = "sm_sayformat 0=100=200=0.05=0.50=2=0.02=5=0.01=0.1=4";

/**********************************  DO NOT EDIT BELOW THIS LINE *****************************/
new STRING_VERSION[MAX_DATA_LENGTH] = "2.3.5";
new TK[MAX_PLAYERS][MAX_PLAYERS]; //format: killer/victim (For use with Victim Menu) 
new TKHistory[MAX_PLAYERS][MAX_PLAYERS]; //format: killer/victim (For use with /whotkedme)
new MenuNeeded[MAX_PLAYERS]; 
new MenuPage[MAX_PLAYERS] = {1, ...};
new gonnaDie[MAX_PLAYERS];
new KickMe[MAX_PLAYERS];
new storedX[MAX_PLAYERS];
new storedY[MAX_PLAYERS];
new storedZ[MAX_PLAYERS];
new TA[MAX_PLAYERS];
new taAllowed = YES;
new RoundID;
new StoredRoundID[MAX_PLAYERS];
new JailedCount;
new StoredPreJailName[MAX_PLAYERS][MAX_NAME_LENGTH];
new PlayerIsJailed[MAX_PLAYERS];
new ChickenCount;
new StoredPreChickenName[MAX_PLAYERS][MAX_NAME_LENGTH];
new PlayerIsChicken[MAX_PLAYERS];
new glowing[MAX_PLAYERS];
new confirmnumber;
new TimeBombRoundID[MAX_PLAYERS];
new pIP[MAX_PLAYERS][MAX_TEXT_LENGTH];

/**********************************  TK FUNCTIONS *****************************/
public sm_death(HLCommand,HLData,HLUserName,UserIndex) {
	if(TKControl == ON) { 
		new eng_msg[MAX_DATA_LENGTH], parm0[4], killer[4], victim[4],hs[4], weapon[32];
		convert_string(HLData,eng_msg,MAX_DATA_LENGTH);	
		strsplit(eng_msg, " ",parm0, 4, killer, 4, victim, 4,hs, 4, weapon, 32);
		new kIndex = strtonum(killer); 
		
		new vIndex = strtonum(victim),msg[MAX_TEXT_LENGTH];
		new kUserID ,kWONID, kTeam, kDead, vUserID ,vWONID, vTeam, vDead, kName[MAX_NAME_LENGTH], vName[MAX_NAME_LENGTH]; 
		//Make sure killer is not 0 (worldspawn) which would cause a invaild index error.
		if(kIndex != 0) {
			playerinfo(kIndex, kName, MAX_NAME_LENGTH, kUserID, kWONID, kTeam, kDead); //Get Killers Info 
			playerinfo(vIndex, vName, MAX_NAME_LENGTH, vUserID, vWONID, vTeam, vDead); //Get Victims Info
						
			//Team Kill
			if(kTeam == vTeam && kDead == NO) { 
				if(access(ACCESS_IMMUNE, kName)!=0 && admins_immune == YES ) {
					snprintf(msg, MAX_TEXT_LENGTH, "* [ATAC]: Sorry, You can't punish admins.");
					say(msg);
				}
				else { 	
					//Store who killed who for menu.
					TK[kIndex][vIndex] += 1;  
			
					//Store who killed who for history.
					TKHistory[kIndex][vIndex] += 1; 
		
					//Menu is now needed for this victim.
					MenuNeeded[vIndex] += 1;
			
					//Call the the menu.
					display_menu(); 
				}
			}
			
			
		}
	}		
	return PLUGIN_CONTINUE; 
}

draw_tkmenu(vIndex,kIndex,page) {
	new vName[MAX_NAME_LENGTH], vUserID , vWONID, vTeam, vDead;
	new menucmd[MAX_DATA_LENGTH];
	new kName[MAX_NAME_LENGTH];
	new CurrentMap[MAX_DATA_LENGTH];
	new FileName[MAX_DATA_LENGTH];
	new option_txt_id1[MAX_DATA_LENGTH];
	new option_txt_id2[MAX_DATA_LENGTH];
	new option_txt_id3[MAX_DATA_LENGTH];
	new option_txt_id4[MAX_DATA_LENGTH];
	new option_txt_id5[MAX_DATA_LENGTH];
	new option_txt_id6[MAX_DATA_LENGTH]; 
	new option_txt_id7[MAX_DATA_LENGTH];
	new option_txt_id8[MAX_DATA_LENGTH];
	new option_txt_id9[MAX_DATA_LENGTH];
	new option_txt_id10[MAX_DATA_LENGTH];
	new option_txt_id11[MAX_DATA_LENGTH];
	new option_txt_id12[MAX_DATA_LENGTH];
	
	//Get Victims Info because Menu needs UserID and we need the players name. 
	playerinfo(vIndex,vName,MAX_NAME_LENGTH,vUserID,vWONID,vTeam,vDead);	
	
	//Make sure killer is still in game and Get Killers Name. 
	if(playerinfo(kIndex, kName, MAX_NAME_LENGTH) == 1) {
		//See if jail is enabled. If it is check to see if COR file is present. 
		if(option_jail == ON) {
			currentmap(CurrentMap,MAX_DATA_LENGTH);
			//Make FileName. 
			snprintf(FileName,MAX_DATA_LENGTH,"atac/%s.cor",CurrentMap);		
			if(fileexists(FileName)==0 ) {
				option_jail = OFF;
			}				
		}
		//See if option_chicken is enabled. If it is check to see if Chicken Mod is present. 
		if(option_chicken == ON) {
			if(getvar("chicken_version")==0) {
				option_chicken = OFF;
			} 
		}
		//Default Option Forgive
		option_txt_id1 = "1. Forgive him\n"; 
		//Count all options that are on.
		if(option_slap == ON) {
			snprintf(option_txt_id2, MAX_DATA_LENGTH, "2. Slap him \\y%i\\w Times\n",tk_slaps);
		}
		if(option_slay == ON) {
			option_txt_id3 = "3. Slay him Now\n";
		}
		if(option_slay_nr  == ON) {
			option_txt_id4 = "4. Slay him Nextround\n";
		}
		if(option_jail == ON) {
			snprintf(option_txt_id5, MAX_DATA_LENGTH, "1. Put him in Jail for \\y%i\\w seconds\n",JailTime);
		}
		if(option_chicken == ON) {
			option_txt_id6 = "2. Make him a Chicken\n"; 
		}
		if(option_bury == ON) {
			option_txt_id7= "3. Bury him\n";
		}
		if(option_glow == ON) {
			option_txt_id8 = "4. Make him glow pink\n";
		}
		if(option_bomb == ON) {
			option_txt_id9 = "1. Make him a ticking bomb\n";
		}
		//Print menu.
		if(page==1) { 		
			snprintf(menucmd, MAX_DATA_LENGTH, "sm_showmenu #%i ^"[ATAC] Choose Punishment for\n\\y%s\\w\n\n%s%s%s%s\n0. More...^" 01234",vUserID,kName,option_txt_id1,option_txt_id2,option_txt_id3,option_txt_id4);
			exec(menucmd);
			snprintf(menucmd, MAX_DATA_LENGTH, "sm_setmenu #%i ^"sm_clexec2 #%i \'hm 1\'^" ^"sm_clexec2 #%i \'hm 2\'^" ^"sm_clexec2 #%i \'hm 3\'^" ^"sm_clexec2 #%i \'hm 4\'^" ^"sm_clexec2 #%i \'hm 5\'^" ",vUserID,vUserID,vUserID,vUserID,vUserID,vUserID);
			exec(menucmd);	
		}
		else if(page==2) { 		
			snprintf(menucmd, MAX_DATA_LENGTH, "sm_showmenu #%i ^"[ATAC] Choose Punishment for\n\\y%s\\w\n\n%s%s%s%s\n0. More...^" 01234",vUserID,kName,option_txt_id5,option_txt_id6,option_txt_id7,option_txt_id8);
			exec(menucmd);
			snprintf(menucmd, MAX_DATA_LENGTH, "sm_setmenu #%i ^"sm_clexec2 #%i \'hm 1\'^" ^"sm_clexec2 #%i \'hm 6\'^" ^"sm_clexec2 #%i \'hm 7\'^" ^"sm_clexec2 #%i \'hm 8\'^" ^"sm_clexec2 #%i \'hm 9\'^" ",vUserID,vUserID,vUserID,vUserID,vUserID,vUserID);
			exec(menucmd);
		}
		else if(page==3) { 		
			snprintf(menucmd, MAX_DATA_LENGTH, "sm_showmenu #%i ^"[ATAC] Choose Punishment for\n\\y%s\\w\n\n%s%s%s%s\n0. ...Back^" 01234",vUserID,kName,option_txt_id9,option_txt_id10,option_txt_id11,option_txt_id12);
			exec(menucmd);
			snprintf(menucmd, MAX_DATA_LENGTH, "sm_setmenu #%i ^"sm_clexec2 #%i \'hm 1\'^" ^"sm_clexec2 #%i \'hm 10\'^" ^"sm_clexec2 #%i \'hm 11\'^" ^"sm_clexec2 #%i \'hm 12\'^" ^"sm_clexec2 #%i \'hm 13\'^" ",vUserID,vUserID,vUserID,vUserID,vUserID,vUserID);
			exec(menucmd);
		}
	}
	return PLUGIN_CONTINUE;
}

display_menu() {
	new maxplayers = maxplayercount();
	new v,k;
	new kIndex;
						
	//Check to see if someone needs the menu sent to them. If so, bind keys and send it.
	for(v = 1; v <= maxplayers;v = v + 1) {
		if(MenuNeeded[v] > 0) {
									
			//Get Killer (if more than one killer, handle last one in array order first)
			for(k = 1; k <= maxplayers;k = k + 1) {
				if(TK[k][v] > 0) {
					kIndex = k;
				}
			}
			//Draw/compile menu and send page one
			draw_tkmenu(v,kIndex,1);
		}
	}	
	return PLUGIN_CONTINUE;
}
			
public hm(HLCommand,HLData,HLUserName,vIndex) {
	new Msg[MAX_DATA_LENGTH];
	new kName[MAX_NAME_LENGTH];
	new vName[MAX_NAME_LENGTH];
	new kIndex, k;
	new maxplayers = maxplayercount();
	new Data[MAX_DATA_LENGTH];
	convert_string(HLData, Data, MAX_DATA_LENGTH);
	new choicenumber = strtonum(Data);
	new strkIndex[MAX_DATA_LENGTH];
	new sName[MAX_NAME_LENGTH],sUserID,sWONID;
	new userconfirmnumber;
	new bx,by,bz; 
	
	if(MenuNeeded[vIndex] > 0) {
		
		//Get Victim Name.
		playerinfo(vIndex, vName, MAX_NAME_LENGTH);
		
		//Get Killer (if more than one killer, handle last one in array order first)
		for(k = 1; k <= maxplayers;k = k + 1) {
			if(TK[k][vIndex] > 0) {
				kIndex = k;
			}
		}
	
		//Make sure killer is still in game and Get Killers Name.
		if(playerinfo(kIndex, kName, MAX_NAME_LENGTH) == 1) {
			//Handle Choice
			switch(choicenumber) {
				case 1: { //More or Back
					//More
					if(MenuPage[vIndex] == 1) {
						draw_tkmenu(vIndex,kIndex,2);
						MenuPage[vIndex] = 2;
					}
					//More
					else if(MenuPage[vIndex] == 2) {
						draw_tkmenu(vIndex,kIndex,3);
						MenuPage[vIndex] = 3;
					}
					//Back
					else if(MenuPage[vIndex] == 3) {
						draw_tkmenu(vIndex,kIndex,1);
						MenuPage[vIndex] = 1;
					}				
				}
				case 2: { //Forgiven
					snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s has forgiven %s",vName,kName);
					say(Msg);
					//1 less menu is needed for victim. 
					MenuNeeded[vIndex] -= 1; 		
					//1 TK is subtracted from Killer.  
					TK[kIndex][vIndex] -= 1;	
					// If Menu is still needed for player call it agian. 
					if(MenuNeeded[vIndex] > 0) {
					display_menu(); 
					}
					//Reset menu page no. for next time
					MenuPage[vIndex] = 1;
				}
				case 3: { //Slap
					if(option_slap == ON) {
						set_timer("SlapHim", 1, tk_slaps, kName);
						//Add 1 kickme/banme point
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s got slapped %i times for TKing %s",kName,tk_slaps,vName);
						say(Msg);
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;
					}
					else if(option_slap == OFF) {
						draw_tkmenu(vIndex,kIndex,1);
					}
						
				}
				case 4: { //Slay
					if(option_slay == ON) {
						slay(kName);
						//Add 1 kickme/banme point
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s is slayed for TKing %s",kName,vName);
						say(Msg);	
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;	
					}
					else if(option_slay == OFF) {
						draw_tkmenu(vIndex,kIndex,1);
					}				
				}
				case 5: { //Die Next Round
					if(option_slay_nr == ON) {
						gonnaDie[kIndex] += 1;
						//Add 1 kickme/banme point 
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s will die next round for TKing %s",kName,vName);
						say(Msg);
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;
					}
					else if(option_slay_nr == OFF) {
						draw_tkmenu(vIndex,kIndex,1);
					}
				}
				case 6: {//Jail
					if (option_jail == ON) {
						//Add 1 kickme/banme point 
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						//Increase Jail Count 						
						JailedCount += 1;
						execclient(kName,"slot1;+attack;wait;-attack;drop");
						execclient(kName,"slot2;+attack;wait;-attack;drop");
						execclient(kName,"slot5;+attack;wait;-attack;drop");
						//Get A Random confirmation number to confim the bomb drop
						userconfirmnumber = random(100);
						confirmnumber = userconfirmnumber; 
						snprintf(Msg, MAX_DATA_LENGTH, "confirmbd %i",userconfirmnumber);
						execclient(kName,Msg);
						//Set the get out of jail timer. 
						numtostr(kIndex,strkIndex);
						set_timer("un_jail", JailTime , 0, strkIndex);
						//Name Handle. Insures that name is not changed twice. 
						if (PlayerIsJailed[kIndex] == NO) {
							StoredPreJailName[kIndex] = kName;
							//Change Name
							snprintf(Msg, MAX_DATA_LENGTH, "name ^"Inmate #00%i^"",JailedCount);
							execclient(kName,Msg);
							PlayerIsJailed[kIndex] = YES;						
						}
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s is in jail for %i seconds for TKing %s",kName,JailTime,vName);
						say(Msg);
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;
					}
					else if(option_jail == OFF) {
						draw_tkmenu(vIndex,kIndex,2);
					}
				}
				case 7: {  //Chicken
					if (option_chicken == ON) {
						//Add 1 kickme/banme point 
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						//Increase Chicken Count.
						ChickenCount += 1; 
						//Make him a chicken model.
						snprintf(Msg, MAX_DATA_LENGTH, "c_chicken # %i", kIndex);
						exec(Msg);
						//Play Sound 
						for(k = 1; k <= maxplayers;k = k + 1) {
							if (playerinfo(k,sName,MAX_NAME_LENGTH,sUserID,sWONID) != 0) {
								playsound(sName, "sound/misc/chicken0");
							}
						}					
						//Name Handle. Insures that name is not changed twice. 
						if (PlayerIsChicken[kIndex] == NO) {
							StoredPreChickenName[kIndex] = kName;
							//Change Name
							snprintf(Msg, MAX_DATA_LENGTH, "name ^"Chicken #00%i^"",ChickenCount);
							execclient(kName,Msg);
							PlayerIsChicken[kIndex] = YES;						
						}
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s has been turned into a Chicken for TKing %s",kName,vName);
						say(Msg);	
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}		
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;		
					}
					else if(option_chicken == OFF) {
						draw_tkmenu(vIndex,kIndex,2);
					}				
				}
				case 8: { //Bury
					if (option_bury == ON) {
						//Add 1 kickme/banme point 
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						execclient(kName,"slot1;+attack;wait;-attack;drop");
						execclient(kName,"slot2;+attack;wait;-attack;drop");
						execclient(kName,"slot5;+attack;wait;-attack;drop");
						get_userorigin(kName,bx,by,bz);
						teleport(kName,bx,by,bz-30);						
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s has buried %s for TKing him.",vName,kName);
						say(Msg);
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;
					}
					else if(option_bury == OFF) {
						draw_tkmenu(vIndex,kIndex,2);
					}
				}
				case 9: { //Glow
					if (option_glow == ON) {
						//Add 1 kickme/banme point 
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s has made %s glow pink for TKing him.",vName,kName);
						say(Msg);
						glow(kName,255,0, 255);
						glowing[kIndex] = YES ;
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;
					}
					else if(option_glow == OFF) {
						draw_tkmenu(vIndex,kIndex,2);
					}
				}
				case 10: { //Bomb
					if (option_bomb == ON) {
						//Add 1 kickme/banme point 
						KickMe[kIndex] += 1; 
						check_v(kIndex);
						snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s has made %s a ticking time bomb for TKing him.",vName,kName);
						say(Msg);
						TimeBombRoundID[kIndex] = RoundID; 
						glow(kName, 0, 0, 255);
						//Set the get out of jail timer. 
						numtostr(kIndex,strkIndex);
						set_timer("time_bomb", 1 , 12, strkIndex);
						//1 less menu is needed for victim. 
						MenuNeeded[vIndex] -= 1; 		
						//1 TK is subtracted from Killer.  
						TK[kIndex][vIndex] -= 1;	
						// If Menu is still needed for player call it agian. 
						if(MenuNeeded[vIndex] > 0) {
						display_menu(); 
						}
						//Reset menu page no. for next time
						MenuPage[vIndex] = 1;
					}
					else if(option_bomb == OFF) {
						draw_tkmenu(vIndex,kIndex,3);
					}
				}
				case 11: { //Future 
					draw_tkmenu(vIndex,kIndex,3);
				}
				case 12: { //Future 
					draw_tkmenu(vIndex,kIndex,3);
				}
				case 13: { //Future 
					draw_tkmenu(vIndex,kIndex,3);
				}
				
			}
		}
	}
	return PLUGIN_CONTINUE;
}

public SlapHim(Timer,Repeat,HLUser,HLParam) {
	new kName[MAX_NAME_LENGTH];
	convert_string(HLParam,kName,MAX_NAME_LENGTH);
	slap(kName);
	return PLUGIN_CONTINUE;
}

public confirmbd(HLCommand,HLData,HLUserName,kIndex) {
	new Data[MAX_DATA_LENGTH];
	convert_string(HLData, Data, MAX_DATA_LENGTH);
	new FileName[MAX_DATA_LENGTH];
	new EntireLine[MAX_DATA_LENGTH];
	new xS[6], yS[6], zS[6];
	new x, y, z;
	new kName[MAX_NAME_LENGTH];
	new CurrentMap[MAX_DATA_LENGTH];
	new userconfirmnumber = strtonum(Data);
	
	if(userconfirmnumber == confirmnumber) {
		playerinfo(kIndex, kName, MAX_NAME_LENGTH);
		//Read CorFile
		currentmap(CurrentMap,MAX_DATA_LENGTH);
		//Make FileName. 
		snprintf(FileName,MAX_DATA_LENGTH,"atac/%s.cor",CurrentMap);
		//Read and store. 
		readfile(FileName, EntireLine,1,MAX_DATA_LENGTH);
		strsplit(EntireLine, " ", xS, 6, yS, 6, zS, 6);
		x = strtonum(xS);
		y = strtonum(yS);
		z = strtonum(zS);
		//Store where player was and the roundID for get out of jail. 
		get_userorigin(kName,storedX[kIndex],storedY[kIndex],storedZ[kIndex]);
		StoredRoundID[kIndex] = RoundID;
		teleport(kName,x,y,z);
		//Reset confirmation Number to aviod invalid calls. 
		confirmnumber = random(100);
	}
}

/**********************************  TA FUNCTIONS *****************************/
public sm_ta(HLCommand,HLData,HLUserName,UserIndex) {
//Check to see if TA Control is on.
	new eng_msg[MAX_DATA_LENGTH], aIndex, msg[MAX_DATA_LENGTH];
	new vIndexS[4], aIndexS[4],junk[4], teamattackS[4],damageS[4], aName[MAX_NAME_LENGTH]; 
	new aWONID, aTeam, aUserID, vIndex, teamattack;
	convert_string(HLData,eng_msg,MAX_DATA_LENGTH);
	//SM_Damage - "receiver" "index_of_attacker" "damage" "aiming_at" "weapon" "team_attacking"
	strsplit(eng_msg, " ",vIndexS, 4, aIndexS, 4, damageS, 4, junk, 4, junk, 4, teamattackS, 4); 			
	teamattack = strtonum(teamattackS); 
	vIndex = strtonum(vIndexS);
	aIndex = strtonum(aIndexS);
	playerinfo(aIndex,aName,MAX_NAME_LENGTH,aUserID,aWONID,aTeam); 
	if(access(ACCESS_IMMUNE, aName)!=0 && admins_immune == YES ) {
		if(teamattack == YES && vIndex != aIndex) {
			if(TAControl == ON) {
				if(aTeam == CT) {
					exec(set_cttd);
				}
				else if(aTeam == T) {
					exec(set_ttd);
				}
				snprintf(msg,MAX_DATA_LENGTH,"sm_tell2 ^"#%i^" ^"[ATAC]:\nTEAMATTACK WARNING IMMUNE\n(Damage Inflicted:%s)^"  ^"5^" ",aUserID,damageS);
				exec(msg);
			}
		}
	}
	else {
		//Make sure victim didn't blow him self-up up and make sure its a Team Attack.
		if(teamattack == YES && vIndex != aIndex) {
			//If TA is not allowed ie. beginning of round slay and print msg.
			if(taAllowed == NO && taNotAllowedFor != OFF) {
				slay(aName);
				//Set Msg Colors by Team
				if(aTeam == CT) {
					exec(set_cttk);
				}
				else if(aTeam == T) {
					exec(set_ttk);
				}
				snprintf(msg,MAX_DATA_LENGTH,"sm_tell2 ^"*^" ^"[ATAC]:\n%s is slayed for attacking a teammate within %i secs of new round^" ^"5^" ",aName,taNotAllowedFor); 
				exec(msg);
				return PLUGIN_CONTINUE;
			}
			//If TA is allowed Slay if enabled and print msg. 
			else if(taAllowed == YES && TAControl == ON) {
							 
				//increase attackers TA by index
				TA[aIndex]+= 1; 
				//Set Msg Colors by Team
				if(aTeam == CT) {
					exec(set_cttd);
				}
				else if(aTeam == T) {
					exec(set_ttd);
				}
				snprintf(msg,MAX_DATA_LENGTH,"sm_tell2 ^"#%i^" ^"[ATAC]:\nTEAMATTACK WARNING %i/%i\n(Damage Inflicted:%s)^"  ^"5^" ",aUserID, TA[aIndex], TA_EQUAL_V,damageS);
				exec(msg);
				if (ta_slap == ON) {
					slap(aName);
				}
				if (TA[aIndex] == TA_EQUAL_V) { 
					//if TA is equal to TA_EQUAL_V then treat it as tk (add 1 TK point)
					KickMe[aIndex] += 1; 
					check_v(aIndex);
					//reset TA count
					TA[aIndex] = 0;  
					if (SlayOnMaxTAs == ON) {
						slay(aName);
					}
				}
			
			}
		}
	}
	return PLUGIN_CONTINUE;
}

//Helper function for TA before x secs
public ta_NA_timer(Timer,Repeat,HLUser,HLParam) {
	taAllowed = YES;
	return PLUGIN_CONTINUE;
}
/********************************** TIME BOMB FUNCTIONS *****************************/
//Explode the killer in 10 seconds.   
public time_bomb(Timer,Repeat,HLUser,HLParam) {
	new kName[MAX_NAME_LENGTH],kSessionID,kWONID,kTeam;
	new kIndex, kIndexS[MAX_DATA_LENGTH],CountDown[MAX_DATA_LENGTH];
	new Red = random(256),Green = random(256),Blue = random(256);
	new Name[MAX_NAME_LENGTH],maxplayers = maxplayercount(), i;
	new pDead,pSessionID,pTeam,pWONID,pName[MAX_NAME_LENGTH],Msg[MAX_DATA_LENGTH];
	new kX,kY,kZ;
	new pX,pY,pZ;
	convert_string(HLParam,kIndexS,MAX_DATA_LENGTH);
	kIndex = strtonum(kIndexS);
	//Make sure player is alive. 
	if(playerinfo(kIndex,kName,MAX_NAME_LENGTH,kSessionID,kWONID,kTeam)==1) {
		//Make sure the round did not restart 
		if(TimeBombRoundID[kIndex] == RoundID) {
			glow(kName, Red, Green, Blue); 
			if (Repeat == 12) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/ten^"");
			}
			if (Repeat == 11) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/nine^"");
			}
			if (Repeat == 10) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/eight^"");
			}
			if (Repeat == 9) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/seven^"");
			}
			if (Repeat == 8) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/six^"");
			}
			if (Repeat == 7) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/five^"");
			}
			if (Repeat == 6) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/four^"");
			}
			if (Repeat == 5) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/three^"");
			}
			if (Repeat == 4) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/two^"");
			}
			if (Repeat == 3) {
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"fvox/one^"");
			}
			if (Repeat == 2) {
				slay(kName);
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"hgrunt/fire!^"");
				//Check if player explosion will hut other players. 
				if(explosion_affects_player == YES) {
					for (i=1; i<=maxplayers; i++) {
						if( playerinfo(i,pName,MAX_NAME_LENGTH,pSessionID,pWONID,pTeam,pDead)==1) {
							get_userorigin(kName, pX, pY, pZ);
							get_userorigin(pName,kX,kY,kZ);
							if( ! (kX-pX > explosion_range || kX-pX < - explosion_range || kY-pY > explosion_range || kY-pY < - explosion_range || kZ-pZ > explosion_range || kZ-pZ < - explosion_range) ) {
								//Slay players in range.
								slay(pName);
							}
						}
					}
				}
					
			}
			if (Repeat == 1) {
				glow(kName,0,0,0); 
				snprintf(CountDown, MAX_DATA_LENGTH, "speak ^"vox/idiot destroyed^"");
			}
			//Speak countdown to all players
			for(i=1; i<=maxplayers; i+=1) {
				if(playerinfo(i,Name,MAX_NAME_LENGTH) == 1) {
					execclient(Name,CountDown);
					if(Repeat >= 2 && Repeat <= 14) { 
						//send countdown text
						if(Repeat >= 3 && Repeat <= 14) { 
							snprintf(Msg, MAX_DATA_LENGTH, "%s will explode in %i",kName,Repeat - 2);
						}
						else if(Repeat == 2 ) { 
							Msg = "FIRE!";
						}
						centersay(Msg,1,Red,Green,Blue);
					}
				}
			}
		}
		//Reset glow if round is new
		if(TimeBombRoundID == RoundID) {
			glow(kName,0,0,0); 
		}
	}
}


/**********************************  JAIL FUNCTIONS *****************************/
//Check if person/persons in jail are the last left on their team alive.  
public un_jail(Timer,Repeat,HLUser,HLParam) {
	new jName[MAX_NAME_LENGTH],jSessionID,jWONID,jTeam,Msg[MAX_DATA_LENGTH];
	new jIndex;
	new jIndexS[MAX_DATA_LENGTH];
	convert_string(HLParam,jIndexS,MAX_DATA_LENGTH);
	jIndex = strtonum(jIndexS);
	//Make sure player is alive. 
	if(playerinfo(jIndex,jName,MAX_NAME_LENGTH,jSessionID,jWONID,jTeam)==1) {
		JailedCount -= 1;
		//Change Name Back to Pre JAIL or REGULAR Name. 
		if(PlayerIsJailed[jIndex] == YES) {
			snprintf(Msg, MAX_DATA_LENGTH, "name ^"%s^"",StoredPreJailName[jIndex]);
			execclient(jName,Msg);
			PlayerIsJailed[jIndex] = NO; 
		}
		//Make sure the round has not restarted before we free our inmate, if it has then he is already freed anyway. 
		if(StoredRoundID[jIndex] == RoundID) {
			snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s has served his jail sentence.",jName);
			say(Msg);
			teleport(jName,storedX[jIndex],storedY[jIndex],(storedZ[jIndex] + 20) );
		}
	}
}

/**********************************  GLOBAL FUNCTIONS *****************************/
check_v(kIndex) {
//Check to see if player has any TK's left
	new wMsg[MAX_DATA_LENGTH];
	new uMsg[MAX_DATA_LENGTH];
	new kName[MAX_NAME_LENGTH];
	new kWONID, kTeam, kSessionID;
	new Date[MAX_TEXT_LENGTH];
	new BanInfo[MAX_DATA_LENGTH];
	
	//Get Killers Info.
	playerinfo(kIndex,kName,MAX_NAME_LENGTH,kSessionID,kWONID,kTeam); 
	
	//Check if user needs to be banned.
	if (KickMe[kIndex] >= TK_before_ban) {
		if(banTime == 0) {
			uMsg = "You have been banned permanently for Team Kill Violations.";
			snprintf(wMsg,MAX_DATA_LENGTH,"sm_tell2 ^"*^" ^"[ATAC]:\nTEAM KILL VIOLATION %i/%i for %s.\nBanning permanently...^" ^"5^"",KickMe[kIndex],TK_before_ban,kName);
		} 
		else {
			snprintf(uMsg,MAX_DATA_LENGTH,"You have been banned for %i mins for Team Kill Violations.",banTime);
			snprintf(wMsg,MAX_DATA_LENGTH,"sm_tell2 ^"*^" ^"[ATAC]:\nTEAM KILL VIOLATION %i/%i for %s.\nBanning for %i mins...^" ^"5^"",KickMe[kIndex],TK_before_ban,kName,banTime);
		}
		messageex(kName,uMsg,print_console);
		
		//Write Ban to log		
		servertime(Date, MAX_NUMBER_LENGTH, "%m/%d/%y %H:%M:%S");
		snprintf(BanInfo, MAX_DATA_LENGTH, "L %s - ^"%s<%s><%i>^" ^"Team Kill Violations: %i of %i banned for %i min^" ",Date,kName,pIP[kIndex],kWONID,KickMe[kIndex],TK_before_ban,banTime);
		writefile("atac/ATACBan.log", BanInfo);
				
		//Ban Player
		if(BanVia == WON_ID) {
			ban(kName,banTime);
		}
		else if(BanVia == IP) {
			snprintf(uMsg,MAX_DATA_LENGTH,"admin_command admin_ban %s %i",pIP[kIndex],banTime);
			exec(uMsg);
			kick(kName);
		}
			
		//Reset TA index JUST INCASE BAN DOESNT WORK. 
		TA[kIndex] = 0;
		
	} else {
		if(banTime == 0) {
			snprintf(wMsg,MAX_DATA_LENGTH,"sm_tell2 ^"*^" ^"[ATAC]:\nTEAM KILL VIOLATION %i/%i for %s.\nOn %i you will be banned permanently.^" ^"5^"",KickMe[kIndex],TK_before_ban,kName,TK_before_ban);	
			}
		else {
			snprintf(wMsg,MAX_DATA_LENGTH,"sm_tell2 ^"*^" ^"[ATAC]:\nTEAM KILL VIOLATION %i/%i for %s.\nOn %i you will be banned for %i mins^" ^"5^"",KickMe[kIndex],TK_before_ban,kName,TK_before_ban,banTime);
		}
	}
	//Set Msg Colors by Team
	if(kTeam == CT) {
		exec(set_cttk);
	}
	else if(kTeam == T) {
		exec(set_ttk);
	}
	exec(wMsg);

	return PLUGIN_CONTINUE;
}

public sm_restart(HLCommand, HLData, HLUserName, UserIndex) {
	new maxplayers = maxplayercount(), i, kName[MAX_NAME_LENGTH], kSessionID, kWONID, kTeam, kDead;
	new event[MAX_DATA_LENGTH],Msg[MAX_DATA_LENGTH],kTeamName[MAX_DATA_LENGTH], timeS[4], time, dummy[4];
	convert_string(HLData, event, MAX_DATA_LENGTH);
	strsplit(event, " ", dummy, 4, timeS, 4);
	time = strtonum(timeS);
	
	//Make sure this function has not been called already this round. 
	if(time == getvar("mp_freezetime")) {
			
		//Make a new round ID by increasing by one for our jailed feature.
		RoundID += 1;
		
		//Make sure taNotAllowedFor NOT off
		if(taNotAllowedFor != OFF) {
			//Set timer for TA within x seconds get slayed.
			taAllowed = NO;
			set_timer("ta_NA_timer", taNotAllowedFor + getvar("mp_freezetime"), 0);
		}
		
		//Loop all players 
		for(i=1; i<=maxplayers; i++) {
			//Reset TA Counts.
			TA[i] = 0;
			//Check to see if player is still in the game.
			if(playerinfo(i,kName,MAX_NAME_LENGTH,kSessionID,kWONID,kTeam)==1) {
				//See if Name Needs to be restored Change Name Back to Pre CHICKEN or REGULAR Name.
				if(PlayerIsChicken[i] == YES) {
					snprintf(Msg, MAX_DATA_LENGTH, "name ^"%s^"",StoredPreChickenName[i]);
					execclient(kName,Msg);
					PlayerIsChicken[i] = NO;
					snprintf(Msg, MAX_DATA_LENGTH, "c_unchicken # %i", i);
					exec(Msg);
					//Get killers Team Name
					if(kTeam == CT) {
						kTeamName = "Counter-Terrorist";
					}
					else if(kTeam == T) {
						kTeamName = "Terrorist";
					}
					snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC] %s has been turned back into a %s.",kName,kTeamName);
					say(Msg);
					
					ChickenCount -= 1;
					PlayerIsChicken[i] = NO;
				}
				//See if Name Needs to be restored Change Name Back to Pre JAIL or REGULAR Name.
				if(PlayerIsJailed[i] == YES) {
					snprintf(Msg, MAX_DATA_LENGTH, "name ^"%s^"",StoredPreJailName[i]);
					execclient(kName,Msg);
					PlayerIsJailed[i] = NO; 
					JailedCount -= 1;
				}	
				//Check if Glowing 
				if(glowing[i] == YES)  {
					glow(kName,0,0,0);
					glowing[i] = NO;
				}
				//Gonna Die Check
				playerinfo(i,kName,MAX_NAME_LENGTH,kSessionID,kWONID,kTeam,kDead);
				if(gonnaDie[i] > 0 && kDead != YES) {
					slay(kName);
					gonnaDie[i] -= 1;
				}
			}
		}
	}
	return PLUGIN_CONTINUE;
}

public plugin_disconnect(HLUserName, UserIndex) {
	new maxplayers = maxplayercount();
	new k,v;
	//If disconnecting player has been killed by anyone erase history of it.
	for(k = 1; k <= maxplayers;k = k + 1) {
		if(TK[k][UserIndex] > 0) {
			TK[k][UserIndex] = 0;
		}
		if(TKHistory[k][UserIndex] > 0) {
			TKHistory[k][UserIndex] = 0;
		}
	}
	
	//If disconnecting player has killed anyone erase history of it. 
	for(v = 1; v <= maxplayers;v = v + 1) {
		//Menu Item
		if(TK[UserIndex][v] > 0) {
			TK[UserIndex][v] = 0;
		}
		//Menu Item
		if(TKHistory[UserIndex][v] > 0) {
			TKHistory[UserIndex][v] = 0;
		}
	}
	
	//Reset his menu needed status.
	MenuNeeded[UserIndex] = NO; 
	
	//Reset their gonna die status. 
	gonnaDie[UserIndex] = NO;
	
	//Player has been kicked or ban or left so reset his KickMe Status.
	KickMe[UserIndex] = 0;
	
	//Erase Stored IP
	pIP[UserIndex] = "0";
	
	return PLUGIN_CONTINUE;
}

public plugin_connect(HLUserName, HLIP, UserIndex) 
{
	new sIP[MAX_TEXT_LENGTH];
	convert_string(HLIP, sIP, MAX_TEXT_LENGTH);
		
	//Token the ip and store it 
	strtok(sIP, ":", pIP[UserIndex], MAX_TEXT_LENGTH);
		
}

public Handle_Say(HLCommand,HLData,HLUserName,UserIndex) {
	new Data[MAX_DATA_LENGTH], msg[MAX_DATA_LENGTH];
	convert_string(HLData, Data, MAX_DATA_LENGTH);
	strstripquotes(Data);
	
	//TK MSG SECTION	
	if(strcmp(Data,"/whotkedme") == 0) {
		new player[MAX_NAME_LENGTH];
		playerinfo(UserIndex, player, MAX_NAME_LENGTH);
		if(TKControl == ON) {
			new maxplayers = maxplayercount();
			new kName[MAX_NAME_LENGTH], SessionID, WONID, Team, k;
			snprintf(msg,MAX_DATA_LENGTH,"* [ATAC] Start of who TKed me (Player/TKed Me x Times)"); 
			messageex(player, msg, print_chat);
			//Look at all killers see if Victims Macth 
			for(k = 1; k <= maxplayers;k = k + 1) {
				//Doulbe check to make sure killer is still in the game since we need to get name anyway.
				if(TKHistory[k][UserIndex] > 0 && playerinfo(k,kName,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
					snprintf(msg,MAX_DATA_LENGTH,"     %s - %i",kName,TKHistory[k][UserIndex]); 
					messageex(player, msg, print_chat);
				} 
			}
			snprintf(msg,MAX_DATA_LENGTH,"* [ATAC] End of who TKed me "); 
			messageex(player, msg, print_chat);
		}
		else if(TKControl == NO) {
			snprintf(msg,MAX_DATA_LENGTH,"* [ATAC] TK Control has been DISABLED by the administrator."); 
			messageex(player, msg, print_chat);
		}
	}
	
	//TA MSG SECTION
	else if(strcmp(Data,"/tastatus") == 0) {
		new player[MAX_NAME_LENGTH];
		playerinfo(UserIndex, player, MAX_NAME_LENGTH);
		if(TAControl == ON) {
			snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: You have %i/%i allowable TA's this round",TA[UserIndex],TA_EQUAL_V); 
			messageex(player, msg, print_chat);
		}
		else if(TAControl == OFF) {
			snprintf(msg,MAX_DATA_LENGTH,"* [ATAC] TA Control has been DISABLED by the administrator."); 
			messageex(player, msg, print_chat);
		}
	}
	
	//VIOLATION MSG SECTION
	else if((strcmp(Data,"/tkstatus") == 0)) {
		new player[MAX_NAME_LENGTH];
		snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: You have %i/%i allowable Team Kill Violations",KickMe[UserIndex],TK_before_ban); 
		playerinfo(UserIndex, player, MAX_NAME_LENGTH);
		messageex(player, msg, print_chat);
	}
	
	return PLUGIN_CONTINUE;
}


/**********************************  ADMIN COMMAND FUNCTIONS  *****************************/
public admin_atac_tac(HLCommand,HLData,HLUserName,UserIndex) {
	new Data[MAX_DATA_LENGTH];
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	
	if (TAControl == ON) {
		TAControl = OFF;
		say("* [ATAC]: THE ADMIN HAS DISABLED TA CONTROL");
		selfmessage("* [ATAC]: TA CONTROL IS NOW (OFF)");
	} else if(TAControl == OFF) {
		TAControl = ON;
		say("* [ATAC]: THE ADMIN HAS ENABLED TA CONTROL");
		selfmessage("* [ATAC]: TA CONTROL IS NOW (ON)");
		
	}
	return PLUGIN_HANDLED;
}

public admin_atac_tkc(HLCommand,HLData,HLUserName,UserIndex) {
	new Data[MAX_DATA_LENGTH];
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	
	if (TKControl == ON) {
		TKControl = OFF;
		say("* [ATAC]: THE ADMIN HAS DISABLED TK CONTROL");
		selfmessage("* [ATAC]: TK CONTROL IS NOW (OFF)");
	} else if(TKControl == OFF) {
		TKControl = ON;
		say("* [ATAC]: THE ADMIN HAS ENABLED TK CONTROL");
		selfmessage("* [ATAC]: TK CONTROL IS NOW (ON)");
	}
	return PLUGIN_HANDLED;
}

public admin_atac_ta_slay(HLCommand,HLData,HLUserName,UserIndex) {
	new Data[MAX_DATA_LENGTH];
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	
	if (SlayOnMaxTAs == ON) {
		SlayOnMaxTAs = OFF;
		say("* [ATAC]: THE ADMIN HAS DISABLED SLAY ON MAX TA'S");
		selfmessage("* [ATAC]: SLAY ON MAX TA'S IS NOW (OFF)");
	} else if(SlayOnMaxTAs == OFF) {
		SlayOnMaxTAs = ON;
		say("* [ATAC]: THE ADMIN HAS ENABLED SLAY ON MAX TA'S");
		selfmessage("* [ATAC]: SLAY ON MAX TA'S IS NOW (ON)");
		
	}
	//Notify admin if TA control is off. 
	if (TAControl == OFF) {
		selfmessage("* [ATAC]: WARNING TEAM ATTACK CONTROL IS DISABLED");
	}
	return PLUGIN_HANDLED;
}

public admin_atac_ta_slap(HLCommand,HLData,HLUserName,UserIndex) {
	new Data[MAX_DATA_LENGTH];
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	if (ta_slap == ON ) {
		ta_slap = OFF;
		say("* [ATAC]: THE ADMIN HAS DISABLED TA SLAPPING");
		selfmessage("* [ATAC]: TA SLAPPING IS NOW (OFF)");
				
	} else if(ta_slap == OFF) {
		ta_slap = ON;
		say("* [ATAC]: THE ADMIN HAS ENABLED TA SLAPPING");
		selfmessage("* [ATAC]: TA SLAPPING IS NOW (ON)");
	}
	//Notify admin if TA control is off. 
	if (TAControl == OFF) {
		selfmessage("* [ATAC]: WARNING TEAM ATTACK CONTROL IS DISABLED");
		
	}
	return PLUGIN_HANDLED;
}

public admin_atac_ta_naf(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new msg[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	new iData = strtonum(Data);
	
	if (iData >= 0 && iData <=100) {
		taNotAllowedFor = iData;
		if(taNotAllowedFor == NO) {
			snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: THE ADMIN HAS DISABLED TA NOT ALLOWED FOR SLAYING",taNotAllowedFor);
			messageex(User, msg, print_console);
			say(msg);
		}
		else { 				
			snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: TA's ARE NOW NOT ALLOWED FOR %i SECONDS.",taNotAllowedFor);
			messageex(User, msg, print_console);
			say(msg);
		}
		
	} else {
		
		snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: INVALID NUMBER (1-100) or (0=OFF)");
		messageex(User, msg, print_console);
	}
	
	return PLUGIN_HANDLED;
}


public admin_addmetk(HLCommand,HLData,HLUserName,UserIndex) {

	//Store who killed who for menu.
	TK[UserIndex][UserIndex] += 1;  
	
	//Menu is now needed for this victim.
	MenuNeeded[UserIndex] += 1;
	
	//Call the the menu.
	display_menu(); 
	
	new Name[MAX_NAME_LENGTH], WONID, Team,SessionID,msg[MAX_DATA_LENGTH];
	playerinfo(UserIndex,Name,MAX_NAME_LENGTH,SessionID,WONID,Team);
	snprintf(msg,MAX_DATA_LENGTH,"%i",Team);
	say(msg);
	return PLUGIN_HANDLED;
}
public plugin_init() {
	new msg[MAX_DATA_LENGTH];
	plugin_registerinfo("[ATAC]","Advanced Team Attack Control",STRING_VERSION);
	
	//test only
	plugin_registercmd("admin_addmetk","admin_addmetk",ACCESS_ATAC,"admin_addmetk");
	
	//ADMIN COMMANDS
	plugin_registercmd("admin_atac_tac","admin_atac_tac",ACCESS_ATAC,"admin_atac_tac: Toggles TEAM ATTACK Control ON and OFF.");
	plugin_registercmd("admin_atac_ta_slay","admin_atac_ta_slay",ACCESS_ATAC,"admin_atac_ta_slay: Toggles Team Attack Limit slaying ON and OFF.");
	plugin_registercmd("admin_atac_ta_slap","admin_atac_ta_slap",ACCESS_ATAC,"admin_atac_ta_slap: Toggles Team Attack Slapping ON and OFF.");
	plugin_registercmd("admin_atac_tkc","admin_atac_tkc",ACCESS_ATAC,"admin_atac_tkc: Toggles TK Control ON and OFF.");
	plugin_registercmd("admin_atac_ta_naf","admin_atac_ta_naf",ACCESS_ATAC,"admin_atac_ta_naf <#>: Sets taNotAllowedFor in seconds (0=OFF)");
			
	//SAY & TK/TA COMMANDS
	plugin_registercmd("say","Handle_Say",ACCESS_ALL);
	plugin_registercmd("confirmbd","confirmbd",ACCESS_ALL);
	plugin_registercmd("sm_ta","sm_ta",ACCESS_CONSOLE,"");
	plugin_registercmd("sm_restart","sm_restart",ACCESS_CONSOLE, "");
	plugin_registercmd("hm", "hm", ACCESS_ALL);
	plugin_registercmd("sm_death","sm_death",ACCESS_CONSOLE,"");
	//SM_Damage - "receiver" "index_of_attacker" "damage" "aiming_at" "weapon" "team_attacking"
	
	//SAY COMMANDS 
	plugin_registerhelp("say",ACCESS_ALL,"say /tastatus - Shows how many TEAM ATTACK Warnings you have.");
	plugin_registerhelp("say",ACCESS_ALL,"say /tkstatus - Show how many Team Attack Violations you have left.");
	plugin_registerhelp("say",ACCESS_ALL,"say /whotkedme - Shows all players that have TKed you.");
	
	//STATSME REGISTARS
	exec("sm_register SM_DeathMsg ^"admin_command sm_death^" ad");
	exec("sm_register RoundTime ^"admin_command sm_restart^" bcd");
	exec("sm_register SM_Damage ^"admin_command sm_ta^" bcd");
	
	//DEFAULT CONFIGURATION FOR ATAC
	exec("mp_tkpunish 0");
	exec("mp_autokick 0");
	exec("allow_client_exec 1");
	snprintf(msg,MAX_DATA_LENGTH,"localinfo atac_version %s",STRING_VERSION);
	exec(msg);	
	return PLUGIN_CONTINUE;

Autor:  LOGi2002 [ 27.07.2002, 09:16 ]
Betreff des Beitrags: 

Zitat:
Also ich habe jetzt das Plugin ausprobiert und nun möchte ich nurnoch eine Sache ändern, und zwar das man nicht gekickt und gebannt wird. Es wäre nett wenn mir jemand zeigen könnte, wo ich das ausstellen kann.

Hier die SMA:
Code:
-1-1-1-2re.ö+ja.hnb
Die Leute hier werden immer verrückter... schön kurz das Plug-In

Autor:  LOGi2002 [ 27.07.2002, 09:21 ]
Betreff des Beitrags: 

ICh hab zwar kein plan vom scripten aber aus logischen gründen würde ich die ganzen

KickMe[kIndex] += 1;

entfernen!

Autor:  Tradikey [ 27.07.2002, 12:57 ]
Betreff des Beitrags: 

Hi

Danke erstmal für deine Mühe, doch ich bekomme immer zu viele Errors.
Jetzt bin ich auf dieses hier im Plugin gestoßen, nur sehe ich da keine Möglichkeit dieses Funktion auszustellen. Leider hat der "Ersteller" des Plugins keine "adminfunktion" reingebaut, dass man zum Beispiel im Spiel in der Console "admin_atacban on/off" machen kann. Hier mal die Stelle, die ich rausgelesen habe und vielleicht kann ja jemand eine weitere "Adminconsolenfunktion" miteinbauen, wo man den automatischen Ban abstellen kann oder vielleicht könnte auch jemand mir die Stelle sagen, wo und wie ich diese Funktion im Plugin ausschalten kann (puh was für ein langer Satz :wink: ).

Ausschniit aus dem Plugin:
Code:
* EXPLANATION: 
*   TK CONTROL: 
*      1. When a player gets TKed menu comes up and displays his revenge options. 
*      2. Unless forgiven the Killers Team Kill Count Increases by one. 
*   TA CONTROL: 
*      1. If player TA's within 'taNotAllowedFor' secs of new round his is slayed. 
*      2. If player TA's after 'taNotAllowedFor' his TA count is increase by one. 
*      3. When player has reached the max. allowable TA's for a specific round his  
*         Team Kill Count Increase by one and if SlayOnMaxTAs is on 
*         then the player is slayed.  
*   [b]TEAM ATTACK VIOLATION: 
*      1. When a play has reached the max Team Kill Violations he is banned for 
*         'banTime' min. [/b]

Autor:  Tradikey [ 13.08.2002, 23:13 ]
Betreff des Beitrags: 

schieb...

Seite 1 von 1 Alle Zeiten sind UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/