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

sm + am plugin..
https://www.adminmod.de/viewtopic.php?t=4648
Seite 1 von 1

Autor:  aRved [ 15.01.2003, 18:40 ]
Betreff des Beitrags:  sm + am plugin..

ja es handelt sich heirbei um das plugin_sm_atac und seitdem ich die neue version von sm habe funzen die ausgaben nich mehr, weshalb ich hier jez nachfragen wollte ob jmd soviel ahnung von beidem [ am + sm ] hat das er sich das plugin mal angucken könnte um den fehler zu erkennen...

Ich glaube der fehler liegt an den TA Functionen, aber hab leider auch nich so den plan vom beiden...die sm_sayformats hab ich auch schon geändert [ hab die = enfernt und dann jeweils mit \' und ' mit = probiert ] wodurch sich aber leider nix bei den ausgaben verändert hat.

Würde mich echt freuen wen s ich jmd das mal angucken könnte :D

Hier der quelltext :
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: 900+ 
*
* 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)
*	
* IMPORTANT:
*	MAKE SURE: 
*		1. mp_tkpunish 0 (server.cfg)
*		2. mp_autokick 0 (server.cfg)
*		3. file_access_read 1 (server.cfg)
*		4. Statsme TK scripts are rem'ed out: 
*			// load statsme scripts 
*			// exec sm_scripts/sm_forgivetk.cfg
*		5. you might wanna add:    sm_motd "   * {I.atac_version?ATAC $:#skip!}" 
*		   to you statsme cfg
*
*
***************************************************************************/ 
#pragma dynamic 16384
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>

#define ACCESS_CONSOLE 131071
#define ACCESS_ATAC 131071
#define ON 1
#define OFF 0
#define YES 1
#define NO 0
#define CT 2
#define T 1

//**********************************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 = OFF;
	new JailTime = 30; // Set the amount of time you want the user jailed for in seconds. 
new option_chicken = OFF;
new option_bury = OFF;
new option_glow = OFF;

//********************************** 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 = 30;

// Set Number of Teamattack Violations you want allowed before user is banned. 
new TK_before_ban = 5;

//********************************** 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 = 4;

//********************************** 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 = 5; 

//********************************** 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.1";
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;
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;

/**********************************  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);
		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) { 
				
				//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 OptionCount; 
	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];
	
	//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. Ich vergebe ihm\n"; 
		//Count all options that are on.
		if(option_slap == ON) {
			OptionCount += 1;
			snprintf(option_txt_id2, MAX_DATA_LENGTH, "2. Ich Schlag ihm in die Fresse\n",tk_slaps);
		}
		if(option_slay == ON) {
			OptionCount += 1;
			option_txt_id3 = "3. Er soll zerplatzen\n";
		}
		if(option_slay_nr  == ON) {
			OptionCount += 1;
			option_txt_id4 = "4. Er soll naechste Runde zerplatzen\n";
		}
		if(option_jail == ON) {
			OptionCount += 1;
			snprintf(option_txt_id5, MAX_DATA_LENGTH, "1. Put him in Jail for \\y%i\\w seconds\n",JailTime);
		}
		if(option_chicken == ON) {
			OptionCount += 1;
			option_txt_id6 = "2. Make him a Chicken\n"; 
		}
		if(option_bury == ON) {
			OptionCount += 1;
			option_txt_id7= "3. Bury him\n";
		}
		if(option_glow == ON) {
			OptionCount += 1;
			option_txt_id8 = "4. Make him glow pink\n";
		}
		//Print menu.
		if(page==1) { 		
			snprintf(menucmd, MAX_DATA_LENGTH, "sm_showmenu #%i ^"Waehle deine Rache an:\n\\y%s\\w\n\n%s%s%s%s\^" 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 ^"Waehle deine Rache an:\n\\y%s\\w\n\n%s%s%s%s^" 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);
		}
	}
	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;
					}
					//Back
					else if(MenuPage[vIndex] == 2) {
						draw_tkmenu(vIndex,kIndex,1);
						MenuPage[vIndex] = 1;
					}				
				}
				case 2: { //Forgiven
					snprintf(Msg, MAX_DATA_LENGTH, "*%s hat ein gutes Herz und vergibt %s den TK*",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, "*%s schlaegt %s wegen TK %imal in die Fresse*",vName,kName,tk_slaps);
						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, "*%s laesst %s zerplatzen*",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_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, "*%s laesst %s naechste Runde zerplatzen*",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_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);
					}
				}
				
			}
		}
	}
	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);
	//Make sure victim didn't blow him self-up up and make sure its a Team Attack.
	if(teamattack == YES && vIndex != aIndex) {
		playerinfo(aIndex,aName,MAX_NAME_LENGTH,aUserID,aWONID,aTeam); 
		//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 ^"*^" ^"%s zerplatzt wegen TA^" ^"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^" ^"TEAMATTACK WARNUNG %i/%i ^"  ^"5^" ",aUserID, TA[aIndex], TA_EQUAL_V);
			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;
}

/**********************************  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;
	//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) {
		snprintf(uMsg,MAX_DATA_LENGTH,"Du wurdest wegen zuvielen TKs fuer %i min. gebannet.",banTime);
		messageex(kName,uMsg,print_console);
		
		//Reset TA index JUST INCASE BAN DOESNT WORK. 
		TA[kIndex] = 0;
		
		//Ban Player
		ban(kName,banTime);
		snprintf(wMsg,MAX_DATA_LENGTH,"sm_tell2 ^"*^" ^"TA WARNUNG %i/%i fuer %s\n Bei 5 TKs wirst du gebanned!^" ^"5^"",KickMe[kIndex],TK_before_ban,kName,banTime);
					
	} else {
		snprintf(wMsg,MAX_DATA_LENGTH,"sm_tell2 ^"*^" ^"TA WARNUNG %i/%i fuer %s\n Bei 5 TKs wirst du gebanned!^" ^"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;
	
	return PLUGIN_CONTINUE;
}

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 plugin_init() {
	new msg[MAX_DATA_LENGTH];
	plugin_registerinfo("[ATAC]","Advanced Team Attack Control",STRING_VERSION);
	
	//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;
}
THX im voraus.. würde mich echt freuen

Autor:  [WING] Black Knight [ 20.01.2003, 00:03 ]
Betreff des Beitrags: 

Statsme und damit Offtopic, sorry!

Autor:  metaxa [ 20.01.2003, 01:07 ]
Betreff des Beitrags: 

Hmm

Das ATAC plugin für Adminmod wird nicht mehr supported, ATAC ist jetzt nen AMX Plugin.

Leider führt ATAC mit SM 2.6.19 zu seltsamen Fehlern. Versuch mal FF_monitor macht prinzipiell das gleiche nur ohne grafisches menu.

Greets


metaxa

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