hi
also erstmal der source, damit keiner extra lange suchen muß *gg*.
Code:
/*
* [WHO]Them's anti-tk script
* original code borrowed from bud-froggy to expedite release
*
* this script is very similar to the anti-tk actions of the original csbot
Edited by Kndroc to be complient with LogD 1.0
Ein wenig entschaerft von [WING]Black Knight
*/
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_CONSOLE 131072
#define TK_BAN_TIME 10
#define AUTOBAN_IN_FIRST_EIGHT_SECONDS 1
#define AUTOBAN_TK_BAN_TIME 10
new STRING_VERSION[MAX_DATA_LENGTH] = "v2.1";
new first_eight_seconds = 0;
new nummenutimers = 0;
new tkedby[MAX_PLAYERS] = {-1,...};
public victimoptionssay(tkid, victimid) {
new outputmessage[MAX_DATA_LENGTH];
new tkname[MAX_NAME_LENGTH];
new victimname[MAX_NAME_LENGTH];
playerinfo(tkid, tkname, MAX_NAME_LENGTH);
playerinfo(victimid, victimname, MAX_NAME_LENGTH);
strcpy(outputmessage, victimname, MAX_DATA_LENGTH);
strcat(outputmessage, " wurde tked von ", MAX_DATA_LENGTH);
strcat(outputmessage, tkname, MAX_DATA_LENGTH);
strcat(outputmessage, ", ", MAX_DATA_LENGTH);
strcat(outputmessage, victimname, MAX_DATA_LENGTH);
strcat(outputmessage, " kann schreiben slap, kill or forgive.", MAX_DATA_LENGTH);
say(outputmessage);
}
public tkr_checktk(HLCommand,HLData,HLUserName,UserIndex)
{
new iIDA;
new iIDV;
new iUserID;
new iWONID;
new iTeamA;
new iTeamV;
new sIDA[3];
new sIDV[3];
new Data[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
strsplit(Data, " ", sIDA, 3, sIDV, 3 );
iIDA = strtonum( sIDA );
iIDV = strtonum( sIDV );
if(playerinfo(iIDA, Data, MAX_NAME_LENGTH, iUserID, iWONID, iTeamA))
{
if(playerinfo(iIDV, Data, MAX_NAME_LENGTH, iUserID, iWONID, iTeamV))
{
if(iTeamV != iTeamA)
return PLUGIN_CONTINUE;
if(first_eight_seconds == 1 && AUTOBAN_IN_FIRST_EIGHT_SECONDS) {
playerinfo(iIDA, Data, MAX_NAME_LENGTH, iUserID, iWONID, iTeamA);
ban(Data, AUTOBAN_TK_BAN_TIME);
}
else {
tkedby[iIDV] = iIDA;
nummenutimers = nummenutimers + 1;
victimoptionssay(iIDA, iIDV);
log("[LogD] tkPunish called");
}
}
}
return PLUGIN_CONTINUE;
}
public tkr_world(HLCommand,HLData,HLUserName,UserIndex)
{
new Params[MAX_DATA_LENGTH];
convert_string(HLData,Params,MAX_DATA_LENGTH);
if(Params[6]=='S') {
first_eight_seconds = 1;
set_timer("eightsecondsover", 8, 0);
}
return PLUGIN_CONTINUE;
}
public eightsecondsover() {
first_eight_seconds = 0;
}
public HandleSay(HLCommand,HLData,HLUserName,UserIndex)
{
new Data[MAX_DATA_LENGTH];
convert_string(HLData, Data, MAX_DATA_LENGTH);
strstripquotes(Data);
if(strcmp(Data,"slap") == 0) {
new tkname[MAX_NAME_LENGTH];
new victimname[MAX_NAME_LENGTH];
playerinfo(tkedby[UserIndex], tkname, MAX_NAME_LENGTH);
playerinfo(UserIndex, victimname, MAX_NAME_LENGTH);
slap(tkname);
slap(tkname);
slap(tkname);
slap(tkname);
slap(tkname);
slap(tkname);
strcpy(Data, victimname, MAX_DATA_LENGTH);
strcat(Data, " entschied slap ", MAX_DATA_LENGTH);
strcat(Data, tkname, MAX_DATA_LENGTH);
strcat(Data, " als TK-Rache.", MAX_DATA_LENGTH);
say(Data);
tkedby[UserIndex] = -1;
nummenutimers = nummenutimers - 1;
} else if(strcmp(Data,"kill") == 0) {
new tkname[MAX_NAME_LENGTH];
new victimname[MAX_NAME_LENGTH];
playerinfo(tkedby[UserIndex], tkname, MAX_NAME_LENGTH);
playerinfo(UserIndex, victimname, MAX_NAME_LENGTH);
slay(tkname);
strcpy(Data, victimname, MAX_DATA_LENGTH);
strcat(Data, " entschied ", MAX_DATA_LENGTH);
strcat(Data, tkname, MAX_DATA_LENGTH);
strcat(Data, " als TK-Rache zu toeten.", MAX_DATA_LENGTH);
say(Data);
tkedby[UserIndex] = -1;
nummenutimers = nummenutimers - 1;
} else if(strcmp(Data,"forgive") == 0) {
new tkname[MAX_NAME_LENGTH];
new victimname[MAX_NAME_LENGTH];
playerinfo(tkedby[UserIndex], tkname, MAX_NAME_LENGTH);
playerinfo(UserIndex, victimname, MAX_NAME_LENGTH);
strcpy(Data, victimname, MAX_DATA_LENGTH);
strcat(Data, " entschied ", MAX_DATA_LENGTH);
strcat(Data, tkname, MAX_DATA_LENGTH);
strcat(Data, " den TK zu vergeben.", MAX_DATA_LENGTH);
say(Data);
tkedby[UserIndex] = -1;
nummenutimers = nummenutimers - 1;
}
return PLUGIN_CONTINUE;
}
public admin_showmenu(HLCommand,HLData,HLUserName,UserIndex)
{
tkedby[UserIndex] = UserIndex;
nummenutimers = nummenutimers + 1;
return PLUGIN_CONTINUE;
}
public plugin_connect(HLUserName, HLIP, UserIndex)
{
new i=1;
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
for(i=1;i<=MAX_PLAYERS;i++) {
if(tkedby[i] == UserIndex) {
tkedby[i] = -1;
nummenutimers = nummenutimers - 1;
}
if(tkedby[UserIndex] != -1) {
tkedby[UserIndex] = -1;
nummenutimers = nummenutimers - 1;
}
}
tkedby[UserIndex] = -1;
}
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLUserName, UserIndex)
{
new i=1;
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
for(i=1;i<=MAX_PLAYERS;i++) {
if(tkedby[i] == UserIndex) {
tkedby[i] = -1;
nummenutimers = nummenutimers - 1;
}
if(tkedby[UserIndex] != -1) {
tkedby[UserIndex] = -1;
nummenutimers = nummenutimers - 1;
}
}
tkedby[UserIndex] = -1;
}
return PLUGIN_CONTINUE;
}
public plugin_init()
{
plugin_registerinfo("Team Killing Detection ([WHO]Them variant)",".",STRING_VERSION);
plugin_registercmd("tkr_checktk", "tkr_checktk", ACCESS_CONSOLE);
plugin_registercmd("tkr_world", "tkr_world", ACCESS_CONSOLE);
plugin_registercmd("say","HandleSay",ACCESS_ALL);
plugin_registercmd("say_team", "HandleSay", ACCESS_ALL);
plugin_registercmd("admin_showmenu", "admin_showmenu", ACCESS_SAY);
exec( "logd_reg 57 admin_command tkr_checktk" );
exec( "logd_reg 62 admin_command tkr_world" );
return PLUGIN_CONTINUE;
}
so also beim combilieren hatte ich 2 fehlermeldung, die ich aber noch hinbekommen habe (die 2 ; die gefehlt haben
).
doch jetzt was anderes. gehe ich richtig in der annahme, das wenn ich
#define AUTOBAN_IN_FIRST_EIGHT_SECONDS 1
auf 0 setze der autobann aus is ??
dann das große problem, das plugin ist ja nicht schlecht, aber warum wird der tkler nicht gekillt, wenn der getklte nix schreibt.
kann doch nicht sein das der dann nächste runde mit daddeln kann
.
genau das fehlt hier im plugin und ich brauch mich erst net an die arbeit machen, da ich das nicht schnalle
.
könnte das vieleicht noch einer einbaun ??? oder den teil hier posten der dann rein muß ins plugin ???
thx für jede hilfe
.
--- bertl ---