habs jetzt ein wenig aufgepeppt (das protectroundstart)
wer es ein wenig auffälliger haben will
Code:
/*********************************************************
* A sample plugin - Version 0.8 *
*********************************************************
* *
* Name: plugin_rindy_ *
* Author: Rinde (rinde@fiatnox.de) *
* Released: 15/11/02 *
* *
* *
* Commands: *
* *
* admin_tkmenu *
* *
* Changelog: *
* *
* Version 0.8 *
* *
* - Initial release *
* *
*********************************************************/
/* Includes */
#include <plugin>
#include <adminlib>
#include <events>
#include <checksetting>
/* Global Variables */
new g_Version[] = "0.8";
new g_maxplayers;
new g_war;
new g_stopthisround;
new g_SECONDS = 10;
new g_SLAY_ATTACKS = 2;
new g_SLAY_DAMAGE = 10;
new g_damage[MAX_PLAYERS];
new g_roundstart;
new Text[MAX_TEXT_LENGTH];
/* Function Declarations */
forward HandleRoundStart(HLCommand,HLData,HLUserName,UserIndex);
forward HandleInjure(HLCommand,HLData,HLUserName,UserIndex);
forward updatewar();
/* Event Handlers */
public plugin_init() {
plugin_registerinfo("Rinde's TA Slay Plugin","Slays players that TA at roundstart",g_Version);
register_logd_event(injure,"HandleInjure");
register_logd_event(round_start,"HandleRoundStart");
if(!get_vaultnumdata("TASLAY_TIME",g_SECONDS)) {
set_vaultnumdata("TASLAY_TIME",g_SECONDS);
}
if(!get_vaultnumdata("TASLAY_DMG",g_SLAY_DAMAGE)) {
set_vaultnumdata("TASLAY_DMG",g_SLAY_DAMAGE);
}
if(!get_vaultnumdata("TASLAY_HITS",g_SLAY_ATTACKS)) {
set_vaultnumdata("TASLAY_HITS",g_SLAY_ATTACKS);
}
g_maxplayers = min(maxplayercount(),32);
return PLUGIN_CONTINUE;
}
/* Command Handlers */
public HandleRoundStart(HLCommand,HLData,HLUserName,UserIndex) {
updatewar();
if(g_war) return PLUGIN_CONTINUE;
new i;
for(i=0;i<=g_maxplayers;i++) {
g_damage[i] = 0;
}
g_roundstart = systemtime();
g_stopthisround = 0;
return PLUGIN_CONTINUE;
}
public HandleInjure(HLCommand,HLData,HLUserName,UserIndex) {
if(g_war || g_stopthisround) return PLUGIN_CONTINUE;
if(g_roundstart + g_SECONDS <= systemtime()) {
g_stopthisround = 1;
return PLUGIN_CONTINUE;
}
static Data[70];
static UserName[MAX_NAME_LENGTH];
new AttackerTeam,VictimTeam;
convert_string(HLData,Data,MAX_DATA_LENGTH);
if(Data[0] != Data[1] && playerinfo(Data[1],UserName,MAX_NAME_LENGTH,_,_,VictimTeam) && playerinfo(Data[0],UserName,MAX_NAME_LENGTH,_,_,AttackerTeam) && AttackerTeam == VictimTeam && !access(ACCESS_IMMUNITY,UserName)) {
g_damage[Data[0]] += max((g_SLAY_DAMAGE / (g_SLAY_ATTACKS-1) -1),Data[2]);
if(g_damage[Data[0]] >= g_SLAY_DAMAGE) {
slay(UserName);
snprintf(Text,MAX_TEXT_LENGTH,"%s has been slain due to teamattack(s) at roundstart",UserName);
typesay(Text,12,random(255),random(255),random(255));
}
}
return PLUGIN_CONTINUE;
}
updatewar() {
static value[10];
get_serverinfo("war",value,10);
g_war = check_param(value);
}
PS.: funzt super...