So, bin fertig!
Das einzige Problem ist: Ich weiß nicht wann die Runde wirklich anfängt!
Ich háb das so gelöst: Ich stelle fest wan sie zuende ist und starte das killen der TKler dann mit 7 Sekunden Verzögerung!
Wenn das zu kurz ist einfach melden!
Hier der Code:
Code:
/*
"The advanced way to punish TK's!" - Plugin
It needs LogD and log "on" and mp_logdetail 3
For help write: netkowalski@web.de or UIN: 120528390
(c) by [TEaM]walski 2002
*/
#include <core> 
#include <console> 
#include <string> 
#include <admin> 
#include <adminlib> 
#define ACCESS_CONSOLE 131072 
#define ACCESS_ADMIN 131071
new STRING_VERSION[MAX_DATA_LENGTH] = "0.1"; 
new NRKill[MAX_PLAYERS];
new HAI=1;
new OnOff=0;
public tkplugin_slay()
{
	new Name[MAX_NAME_LENGTH];
	new sI[MAX_DATA_LENGTH];
	for (new i=1;i<HAI+1;i=i+1)
      	{
		if (NRKill[i]!=0)
      		{
			numtostr(NRKill[i],sI);
      			get_username(sI,Name,MAX_NAME_LENGTH);
      			execclient(Name,"kill");
      			centersay("SLAYED FOR TK LAST ROUND",5,255,0,0);
      			NRKill[i]=0
      		}
      	}
      	return PLUGIN_HANDLED;
}
	
public tkplugin_kill( HLCommand,HLData,HLUserName,UserIndex ) 
{	
   	if (OnOff!=0)
   	{
   		new iIDA; 
   		new iIDV; 
   		new sIDA[MAX_NAME_LENGTH]; 
   		new sIDV[MAX_NAME_LENGTH]; 
   		new Data[MAX_DATA_LENGTH];
   		new Team1;
   		new Team2;
   		new Dead;
   		new UID;
   		new WONID;
	   	   	         
	   	convert_string( HLData, Data, MAX_DATA_LENGTH ); 
	   	strsplit(Data," ",sIDA,MAX_NAME_LENGTH,sIDV,MAX_NAME_LENGTH); 
	       	iIDA = strtonum(sIDA); 
	   	iIDV = strtonum(sIDV); 
	   	playerinfo(iIDA, sIDA, MAX_NAME_LENGTH, UID, WONID, Team1, Dead);
	   	playerinfo(iIDV, sIDV, MAX_NAME_LENGTH, UID, WONID, Team2);
	   	if (Team1==Team1 || Dead==0)
	   	{
   			NRKill[HAI]=iIDA
   			HAI=HAI+1
   		}
   		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}
	
public tkplugin_reset(HLCommand,HLData,HLUserName,UserIndex,Param) 
{
	if (OnOff!=0)
	{
		new Data[MAX_NAME_LENGTH]; 
		convert_string(HLData,Data,MAX_NAME_LENGTH); 
    
	   	if(   strcmp(   "Round_Start", Data   ) != 0 )
	   	{
      			set_timer("tkplugin_slay",7,1);
      		}
      		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}
public tkplugin_onoff( HLCommand,HLData,HLUserName,UserIndex)
{
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Text[MAX_DATA_LENGTH];
	new On;
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
	if (strlen(Data)==0)
	{
		snprintf(Text,MAX_DATA_LENGTH,"Use of this command:^ntkpplugin_onoff^n0 to turn off, 1 to turn it on.^nAt the moment it is: %i",OnOff);
		messageex(User,Text,print_console);
		return PLUGIN_HANDLED;
	}
	snprintf(Text,MAX_DATA_LENGTH,"The TK-punish is now %s",Data);
	messageex(User,Text,print_console);
	set_vaultdata("tkpunish_onoff", Data)
	On=strtonum(Data);
	OnOff=On;
	return PLUGIN_HANDLED;
}
	
public plugin_init() 
{ 
   plugin_registerinfo("TK-Script","An advanced way for TK-punishment",STRING_VERSION); 
   plugin_registercmd("tkplugin_kill", "tkplugin_kill", ACCESS_CONSOLE, ""); 
   plugin_registercmd("tkplugin_reset", "tkplugin_reset", ACCESS_CONSOLE, ""); 
   plugin_registercmd("tkplugin_onoff", "tkplugin_onoff", ACCESS_ADMIN, ""); 
    
   exec( "logd_reg 57 admin_command tkplugin_kill" ); 
   exec( "logd_reg 62 admin_command tkplugin_reset" ); 
   
   new Data[MAX_DATA_LENGTH];
   new On;
   get_vaultdata("tkpunish_onoff", Data, MAX_DATA_LENGTH);
   On=strtonum(Data);
   OnOff=On;
        
   return PLUGIN_CONTINUE; 
} 
Viel Spaß!
Und wie immer Bugs und Fragn in diesen Thread!!
kowalski