Das übers commandmenu benutzt doch eh niemand ich benutze die slap und kick funktionen von clanmod da dort alle player aufgelistet sind viel besser/einfacher is das
aber ich hab gestern n Statsme/Adminmod Plugin gefunden
Es is recht geil gemacht allerdings muss dadran noch sehr viel gefeilt werden
Also was man da ändern muss
1. Dieses ******* Menu muss raus
2. Die Ban Funktion muss raus
3. Die Kick Funktion muss raus
4. Wenn jemand n Teamkill macht soll derjenige nur geslapt werden bzw. das plugin soll ganz normal weiterlaufen (So das 1 Teamattack dazugezählt wird)
Naja ich schreib lieber ma was das plugin können
muss damit es einen Award verdient hat =)
Also fang wa ma an:
wenn jemand in den ersten 10 Sek. (zeit muss einstellbar sein/klappt bisher nämlich noch nich) einen Teamattack macht soll n Slay kommen (mit admin_fx 1 kommt das sehr geil
) wenn danach jemand auf n Teammate schießt soll n Slap kommen und der soll mitgezählt werden (is im moment auch so) wenn jemand 3 (muss auch einstellbar sein) ma (in einer Runde) n Teammate angeschossen hat soll beim 3ten ma n Slay kommen (im moment steht das auf 5 und dann passiert nix ausser das irgendwas anderes weitergezählt wird (ich glaub bis jemand gekickt wird)
So ich hoffe ich hab nix vergessen, ich habe auch schon versucht das selber hinzubekommen habs bisher aber noch nicht geschafft.
Kuckt euch das plugin am besten mal selber an also ich finds sehr geil (bis auf die paar kleinen macken)
So hier der Code:
Das Plugin kann man übrigens auch auf:
http://www.olo.counter-strike.pl downloaden
Code:
/***************************************************************************
* Advanced Team Attack Control [ATAC] AM Plugin for use with StatsMe (v2.5.1 or higher) MetaMod plugin.
* May 26th, 2002
* http://www.olo.counter-strike.pl
* http://www.adminmod.org
* Written & Optimised by F117Bomb & [DsV]T(+)rget
* Special Thanks to: PsychoGuard and OLO.
* Contact TheJew@socal.rr.com or target@dreamscapevirus.com
*
* ADMIN COMMANDS:
* admin_atac_tdc: Toggles TD Control ON and OFF.
* admin_atac_td_slay: Toggles TD Limit slaying ON and OFF.
* admin_atac_td_slap: Toggles TD Slapping ON and OFF.
* admin_atac_tkc: Toggles TK Control ON and OFF.
*
* SAY COMMANDS:
* /tdstatus - Shows how many TD's you have left.;
* /violationstatus - Show how many Team Attack Violations you have left.
* /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 Attack Violation Count Increase by one.
* TD CONTROL:
* 1. If player TD's within 'tdNotAllowedFor' secs of new round his is slayed.
* 2. If player TD's after 'tdNotAllowedFor' his TD count is increase by one.
* 3. When player has reached the max. allowable TD's for a specific round his
* Team Attack Violation Count Increase by one and if SlayOnMaxTDs is on
* then the player is slayed.
* TEAM ATTACK VIOLATION:
* 1. When a play has reached the max Team Attack Violations he is ban for
* 'banTime' min.
*
*
* IMPORTANT:
* Make sure: mp_tkpunish 0 & sm_tkpunish 0 & mp_autokick 0
*
* ALSO
*
* Edit your statsme.cfg and add the 3 aliases underneath:
*
* // (i.e. sm_sayformat "0=100=200=-1=0.25=0=6=6=1=1=1")
*
* alias set_td "sm_sayformat 0=80=220=0.75=0.50=2=0.02=5=0.01=0.1=3"
* alias set_tk "sm_sayformat 220=80=0=0.05=0.50=2=0.02=5=0.01=0.1=4"
* alias set_vm "sm_sayformat 255=255=255=0.05=0.50=2=0.02=5=0.01=0.1=5"
*
***************************************************************************/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_CONSOLE 131071
#define ACCESS_ATAC 131071
//Team Attack 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 = 5;
// Set Number of Teamattack Violations you want allowed before user is banned.
//(can NOT be higher than 9)
new TAV_before_ban = 5;
//TD Variables---------------------------------------------------------------------------------------
// Turns on and off TD Control. (0=OFF, 1=ON)
// NOTE: Can be changed in game.
new TDControl = 1;
// Sets Instant slaying when MAX TD's are reached ON or OFF. (0=OFF, 1=ON)
// NOTE: Can be changed in game.
new SlayOnMaxTDs = 0;
// Set Slapping ON or OFF when someone TD's. (0=OFF, 1=ON)
// NOTE: Can be changed in game.
new td_slap = 1;
// Amount of time(seconds) after round start that TD'ers are slayed.
new tdNotAllowedFor = 5;
// Set Number of TD's you want to be counted as a Violation. (can NOT be higher than 9)
new TD_EQUAL_V = 5;
//TK Variables---------------------------------------------------------------------------------------
// Turns on and off TD Control. (0=OFF, 1=ON)
// NOTE: Can be changed in game.
new TKControl = 1;
//Set to how many times you want a Victim to beable to slap his Tker.
new tk_slaps =5;
//DO NOT EDIT BELOW THIS LINE----------------------------------------------------------------------------------------------
new STRING_VERSION[MAX_DATA_LENGTH] = "2.0.2";
new TK[MAX_PLAYERS][MAX_PLAYERS]; //format: killer/victim
new TKHistory[MAX_PLAYERS][MAX_PLAYERS]; //format: killer/victim
new MenuNeeded[MAX_PLAYERS];
new MenuKeysBinded[MAX_PLAYERS];
new gonnaDie[MAX_PLAYERS];
new KickMe[MAX_PLAYERS];
new TD[MAX_PLAYERS];
new tdNotAllowed;
//TK FUNCTIONS--------------------------------------------------------------------------------------------------------------
public sm_death(HLCommand,HLData) {
if(TKControl == 1) {
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) witch 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 == 0) {
//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;
//Start the loop to display the menu
display_menu();
}
}
}
return PLUGIN_CONTINUE;
}
public display_menu() {
new maxplayers = maxplayercount();
new v,k;
new vName[MAX_NAME_LENGTH];
new menumsg[MAX_DATA_LENGTH];
new kIndex;
new kName[MAX_NAME_LENGTH];
//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 name.
playerinfo(v, 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][v] > 0) {
kIndex = k;
}
}
//Get Killers Name.
playerinfo(kIndex, kName, MAX_NAME_LENGTH);
//Bind Keys if not already binded.
if(MenuKeysBinded[v] == 0) {
execclient(vName, "bind 1 ^"handlemenu 1^";bind 2 ^"handlemenu 2^";bind 3 ^"handlemenu 3^";bind 4 ^"handlemenu 4^"");
MenuKeysBinded[v] = 1;
}
//Send Menu.
exec("set_vm");
snprintf(menumsg, MAX_DATA_LENGTH, "sm_tell ^"%s^" ^"[ATAC] How do you want to punish:\n %s? \n\n1. Forgive \n2. Slap %i Times\n3. Slay Now\n4. Slay Nextround ^"",vName,kName,tk_slaps);
exec(menumsg);
set_timer("display_menu", 4, 0);
}
}
return PLUGIN_CONTINUE;
}
public handlemenu(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new Msg[MAX_DATA_LENGTH];
convert_string(HLData, Data, MAX_DATA_LENGTH);
new choicenumber = strtonum(Data);
new kName[MAX_NAME_LENGTH];
new vName[MAX_NAME_LENGTH];
new vIndex = UserIndex;
new kIndex;
new maxplayers = maxplayercount();
new k;
//Make sure the handlemenu call is valid
if(MenuNeeded[vIndex] == 0) {
return PLUGIN_CONTINUE;
}
else 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;
}
}
//Get Killers Name.
playerinfo(kIndex, kName, MAX_NAME_LENGTH);
//Unbind Victim Keys.
execclient(vName, "bind 1 slot1;bind 2 slot2;bind 3 slot3;bind 4 slot4");
MenuKeysBinded[vIndex] = 0;
//1 less menu is needed for victim.
MenuNeeded[vIndex] -= 1;
//1 TK is subtracted from Killer.
TK[kIndex][vIndex] -= 1;
//Punish Player
switch(choicenumber) {
case 1:
{
snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s has forgiven %s",vName,kName);
say(Msg);
}
case 2:
{
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 has slapped %s %i times for TKing him",vName,kName,tk_slaps);
say(Msg);
}
case 3:
{
slay(kName);
//Add 1 kickme/banme point
KickMe[kIndex] += 1;
check_v(kIndex);
snprintf(Msg, MAX_DATA_LENGTH, "* [ATAC]: %s slayed %s for TKing him",vName,kName);
say(Msg);
}
case 4:
{
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",kName);
say(Msg);
}
}
}
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;
}
//TD FUNCTIONS--------------------------------------------------------------------------------------------------------------
public sm_td(HLCommand,HLData) {
//Check to see if TD Control is on.
if(TDControl == 1) {
new eng_msg[MAX_DATA_LENGTH];
new junk[4], junk2[4], event[MAX_DATA_LENGTH], aName[MAX_DATA_LENGTH];
convert_string(HLData,eng_msg,MAX_DATA_LENGTH);
strgsplit(eng_msg, " ","^"", junk, 4, junk2, 4, event, MAX_DATA_LENGTH, aName, MAX_DATA_LENGTH);
//If TD is not allowed ie. begining of round slay and print msg.
if(tdNotAllowed == 1) {
new aUserID ,aWONID, aTeam, aDead, aIndex, msg[MAX_DATA_LENGTH];
get_userindex(aName,aIndex); // get attakers index from name
playerinfo(aIndex, aName, MAX_NAME_LENGTH, aUserID, aWONID, aTeam, aDead); //Get Attacker Info
slay(aName);
exec("set_tk");
snprintf(msg,MAX_DATA_LENGTH,"sm_say ^"[ATAC]:\n%s is slayed for TDing within %i secs of new round^"",aName,tdNotAllowedFor);
exec(msg);
return PLUGIN_CONTINUE;
}
//If TD is allowed Slay if enabled and print msg.
else if(tdNotAllowed == 0) {
new aUserID ,aWONID, aTeam, aDead, aIndex, msg[MAX_DATA_LENGTH];
get_userindex(aName,aIndex); // get attakers index from name
playerinfo(aIndex, aName, MAX_NAME_LENGTH, aUserID, aWONID, aTeam, aDead); //Get Attacker Info
//increase attackers td by index
TD[aIndex] += 1; //increase attackers td by index
exec("set_td");
snprintf(msg,MAX_DATA_LENGTH,"sm_tell ^"%s^" ^"[ATAC]:\nTEAMDAMAGE WARNING %i/%i^"",aName, TD[aIndex], TD_EQUAL_V);
exec(msg);
if (td_slap == 1) {
slap(aName);
}
if (TD[aIndex] == TD_EQUAL_V) {
//if td is equal to TD_EQUAL_V then treat it as tk (add 1 TK point)
KickMe[aIndex] += 1;
check_v(aIndex);
//reset td count
TD[aIndex] = 0;
if (SlayOnMaxTDs == 1) {
slay(aName);
}
}
}
}
return PLUGIN_CONTINUE;
}
//Helper function for TD before x secs
public td_NA_timer() {
tdNotAllowed = 0;
return PLUGIN_CONTINUE;
}
//GLOBAL FUNCTIONS--------------------------------------------------------------------------------------------------------------
public 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];
playerinfo(kIndex, kName, MAX_NAME_LENGTH);
exec("set_tk");
//Check if user needs to be banned.
if (KickMe[kIndex] >= TAV_before_ban) {
snprintf(wMsg,MAX_DATA_LENGTH,"sm_say ^"[ATAC]:\nTEAMATTACK VIOLATION %i/%i for %s.\nBanning for %i mins^"",KickMe[kIndex],TAV_before_ban,kName,banTime);
snprintf(uMsg,MAX_DATA_LENGTH,"You have been banned for %i mins for Team Attack Violations.",banTime);
messageex(kName,uMsg,print_console);
ban(kName, banTime);
} else {
snprintf(wMsg,MAX_DATA_LENGTH,"sm_say ^"[ATAC]:\nTEAMATTACK VIOLATION %i/%i for %s.\nOn %i you will be banned for %i mins^"",KickMe[kIndex],TAV_before_ban,kName,TAV_before_ban,banTime);
}
exec(wMsg);
return PLUGIN_CONTINUE;
}
public sm_restart(HLCommand, HLData, HLUserName, UserIndex) {
new maxplayers = maxplayercount();
new i;
new kName[MAX_NAME_LENGTH], SessionID, WONID, Team, Dead;
new event[MAX_DATA_LENGTH];
new timeS[4];
new time;
new 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_roundtime") * 60) {
//Reset TD Counts.
for(i=1; i<=maxplayers; i++) {
TD[i] = 0;
}
//Set timer for TD within x seconds get slayed.
if(tdNotAllowed != 1){
tdNotAllowed = 1;
set_timer("td_NA_timer", tdNotAllowedFor + getvar("mp_freezetime"), 0);
}
//Check all players to see if there goonaDie status is set above 1.
for(i=1; i<=maxplayers; i++) {
//Check to see if player is still in the game.
if(playerinfo(i,kName,MAX_NAME_LENGTH,SessionID,WONID,Team)==1) {
playerinfo(i,kName,MAX_NAME_LENGTH,SessionID,WONID,Team,Dead)
if(gonnaDie[i] > 0 && Dead != 1) {
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 Keys binded status.
MenuKeysBinded[UserIndex] = 0;
//Reset his menu needed status.
MenuNeeded[UserIndex] = 0;
//Reset their gonna die status.
gonnaDie[UserIndex] = 0;
//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 == 1) {
new maxplayers = maxplayercount();
new kName[MAX_NAME_LENGTH], SessionID, WONID, Team, k;
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC} Start of who TKed me.");
messageex(player, msg, print_chat);
//Look at all killers see if Victims Macth Query
for(k = 1; k <= maxplayers;k = k + 1) {
//Doulbe check to make sure killer is still in the game.
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 == 0) {
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC} TK Control has been DISABLED by the administrator.");
messageex(player, msg, print_chat);
}
}
//TD MSG SECTION
else if(strcmp(Data,"/tdstatus") == 0) {
new player[MAX_NAME_LENGTH];
playerinfo(UserIndex, player, MAX_NAME_LENGTH);
if(TDControl == 1) {
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: You have %i/%i allowable TD's this round",TD[UserIndex],TD_EQUAL_V);
messageex(player, msg, print_chat);
}
else if(TKControl == 0) {
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC} TD Control has been DISABLED by the administrator.");
messageex(player, msg, print_chat);
}
}
//VIOLATION MSG SECTION
else if(strcmp(Data,"/violationstatus") == 0) {
new player[MAX_NAME_LENGTH];
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: You have %i/%i allowable Team Attack Violations",KickMe[UserIndex],TAV_before_ban);
playerinfo(UserIndex, player, MAX_NAME_LENGTH);
messageex(player, msg, print_chat);
}
return PLUGIN_CONTINUE;
}
//ADMIN COMMAND FUNCTIONS--------------------------------------------------------------------------------------------------------------
public admin_atac_tdc(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);
if ( TDControl == 1 ) {
TDControl = 0;
say("* [ATAC]: THE ADMIN HAS DISABLED TD CONTROL");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: TD CONTROL IS NOW (OFF)");
messageex(User, msg, print_console);
} else if(TDControl == 0) {
TDControl = 1;
say("* [ATAC]: THE ADMIN HAS ENABLED TD CONTROL");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: TD CONTROL IS NOW (ON)");
messageex(User, msg, print_console);
}
return PLUGIN_HANDLED;
}
public admin_atac_tkc(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);
if ( TKControl == 1 ) {
TKControl = 0;
say("* [ATAC]: THE ADMIN HAS DISABLED TK CONTROL");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: TK CONTROL IS NOW (OFF)");
messageex(User, msg, print_console);
} else if(TKControl == 0) {
TKControl = 1;
say("* [ATAC]: THE ADMIN HAS ENABLED TK CONTROL");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: TK CONTROL IS NOW (ON)");
messageex(User, msg, print_console);
}
return PLUGIN_HANDLED;
}
public admin_atac_td_slay(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);
if (SlayOnMaxTDs == 1 ) {
SlayOnMaxTDs = 0;
say("* [ATAC]: THE ADMIN HAS DISABLED SLAY ON MAX TD'S");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: SLAY ON MAX TD'S IS NOW (OFF)");
messageex(User, msg, print_console);
} else if(SlayOnMaxTDs == 0) {
SlayOnMaxTDs = 1;
say("* [ATAC]: THE ADMIN HAS ENABLED SLAY ON MAX TD'S");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: SLAY ON MAX TD'S IS NOW (ON)");
messageex(User, msg, print_console);
}
//Notify admin if TD control is off.
if (TDControl == 0) {
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: WARNING TD IS DISABLED");
messageex(User, msg, print_console);
}
return PLUGIN_HANDLED;
}
public admin_atac_td_slap(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);
if (td_slap == 1 ) {
td_slap = 0;
say("* [ATAC]: THE ADMIN HAS DISABLED TD SLAPPING");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: TD SLAPPING IS NOW (OFF)");
messageex(User, msg, print_console);
} else if(td_slap == 0) {
td_slap = 1;
say("* [ATAC]: THE ADMIN HAS ENABLED TD SLAPPING");
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: TD SLAPPING IS NOW (ON)");
messageex(User, msg, print_console);
}
//Notify admin if TD control is off.
if (TDControl == 0) {
snprintf(msg,MAX_DATA_LENGTH,"* [ATAC]: WARNING TD IS DISABLED");
messageex(User, msg, print_console);
}
return PLUGIN_HANDLED;
}
public plugin_init() {
plugin_registerinfo("[ATAC]","Advanced Team Attack Control",STRING_VERSION);
//ADMIN COMMANDS
plugin_registercmd("admin_atac_tdc","admin_atac_tdc",ACCESS_ATAC,"admin_atac_tdc: Toggles TD Control ON and OFF.");
plugin_registercmd("admin_atac_td_slay","admin_atac_td_slay",ACCESS_ATAC,"admin_atac_td_slay: Toggles TD Limit slaying ON and OFF.");
plugin_registercmd("admin_atac_td_slap","admin_atac_td_slap",ACCESS_ATAC,"admin_atac_td_slap: Toggles TD Slapping ON and OFF.");
plugin_registercmd("admin_atac_tkc","admin_atac_tkc",ACCESS_ATAC,"admin_atac_tkc: Toggles TK Control ON and OFF.");
//SAY & TK/TD COMMANDS
plugin_registercmd("say","Handle_Say",ACCESS_ALL);
plugin_registercmd("sm_td","sm_td",ACCESS_CONSOLE,"");
plugin_registercmd("sm_restart","sm_restart",ACCESS_CONSOLE, "");
plugin_registercmd("handlemenu", "handlemenu", ACCESS_ALL);
plugin_registercmd("sm_death","sm_death",ACCESS_CONSOLE,"");
//SAY COMMANDS
plugin_registerhelp("say",ACCESS_ALL,"say /tdstatus - Shows how many TD's you have left.");
plugin_registerhelp("say",ACCESS_ALL,"say /violationstatus - 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 DeathMsg ^"admin_command sm_death^" ad");
exec("sm_register RoundTime ^"admin_command sm_restart^" bdc");
exec("sm_register TextMsg ^"admin_command sm_td^" bc 2=#Game_teammate_a");
return PLUGIN_CONTINUE;
}