okay
der knifemode sollte demjenigen, der gerade "iwantplant" gesagt hat, ermöglichen, ausserdem noch die bombe anzuwählen. den iwantplant befehl kann nur einer zur zeit benutzen, und nur lebende terroristen. spieler, die nach rundenneustart joinen, erhalten ebenfalls noclip (hoffe ich zumindest). ka was ich noch alles geändert hab, alles mögliche. have phun
Code:
/**
* Gh0sTbUsTeR Mode by CoWs | Element
* devilzero@tiscalinet.ch <mailto:devilzero@tiscalinet.ch>
* Modifiziert dieses Plugin so viel ihr wollt
* aber laesst mir nen Credit uebrig ;)
*/
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_GB 8192
#define ACCESS_CONSOLE 131072
#define T 3
new STRING_VERSION[MAX_DATA_LENGTH]= "2.50.50";
new GBMode;
new Planting = 0;
new Noclip[MAX_PLAYERS];
public admin_gbmode(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new UserName[MAX_NAME_LENGTH];
convert_string(HLCommand,Command,MAX_NAME_LENGTH);
convert_string(HLData,Data,MAX_NAME_LENGTH);
convert_string(HLUserName,UserName,MAX_NAME_LENGTH);
if(strlen(Data) == 0) {
snprintf(Data,MAX_TEXT_LENGTH,"^"admin_gbmode^" is ^"%i^"",GBMode);
selfmessage(Data);
} else if(check_param(Data) > GBMode) {
set_vaultdata("logd_gb","1");
GBMode = 1;
exec("sv_restartround 10");
centersay("Gh0sTbUsTeR Mode startet in 10 sekunden.",10, 10, 255, 255);
say_command(UserName,Command,Data);
set_timer("nolipall",10,0);
} else if(check_param(Data) < GBMode) {
set_vaultdata("logd_gb","0");
GBMode = 0;
exec("sv_restartround 10");
say_command(UserName,Command,Data);
centersay("Gh0sTbUsTeR Mode vorbei...*sniff*", 12, 10, 255, 255);
}
return PLUGIN_HANDLED;
}
public plugin_command(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new UserName[MAX_NAME_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
if(GBMode == 1 && strncmp(Command,"weapon_",7) == 0 && strcmp(Command,"weapon_knife") != 0 && (Planting != UserIndex || strcmp(Command,"weapon_c4") != 0)) {
convert_string(HLUserName,UserName,MAX_NAME_LENGTH);
execclient(UserName,"weapon_knife");
messageex(UserName,"You may not use other weapons than knives in Gh0sTbUsTeR Mode",print_chat);
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public HandleSay(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new UserName[MAX_NAME_LENGTH];
new Team,Dead;
convert_string(HLData,Data,MAX_DATA_LENGTH);
strstripquotes(Data);
if (GBMode == 1 && strcasestr(Data,"iwantplant") != -1 && Planting == 0 && playerinfo(UserIndex,UserName,MAX_NAME_LENGTH,_,_,Team,Dead) == 1 && Team == 1 && Dead == 0) {
noclip(UserName, 0);
Planting = UserIndex;
execclient(UserName,"weapon_c4");
set_timer("TimerNoClip",10,0);
}
return PLUGIN_CONTINUE;
}
public TimerNoClip(Timer,Repeat,HLUserName,HLParam) {
new UserName[MAX_NAME_LENGTH];
convert_string(HLUserName,UserName,MAX_NAME_LENGTH);
Planting = 0;
noclip(UserName,1);
}
public noclipall(Timer,Repeat,HLUserName,HLParam) {
new UserName[ MAX_NAME_LENGTH ];
new Dead;
new i;
if(GBMode == 1) {
for(i=1;i<=maxplayercount();i++) {
if(playerinfo(i,UserName, MAX_NAME_LENGTH,_,_,_,Dead) == 1 && Dead == 0 && Noclip[i] == 0) {
noclip(UserName, 1);
execclient(UserName,"weapon_knife");
Noclip[i] = 1;
}
}
set_timer("nolipall",T,0);
}
}
public specmode(HLCommand,HLData,HLUserName,UserIndex) {
Noclip[UserIndex] = 0;
}
public logd_ghostbusters(HLCommand,HLData,HLUserName,UserIndex) {
new i;
for(i=1;i<MAX_PLAYERS;i++) {
Noclip[i] = 0;
}
}
public plugin_init() {
plugin_registerinfo("Gh0sTbUsTeR Mode","Noclips all players and gives them special commands",STRING_VERSION);
plugin_registercmd("say_team","HandleSay",ACCESS_ALL);
plugin_registercmd("admin_gbmode", "admin_gbmode", ACCESS_GB, "admin_gbmode <1 || 0> Gh0sTbUsTeR Mode");
plugin_registercmd("specmode", "specmode", ACCESS_ALL);
plugin_registercmd("logd_ghostbusters", "logd_ghostbusters", ACCESS_CONSOLE);
plugin_registerhelp("say_team",ACCESS_ALL,"say_team iwantplant: Disables noclipmode on you for 10 seconds");
exec( "logd_reg 62 admin_command logd_ghostbusters" );
get_vaultnumdata("logd_gb",GBMode);
set_timer("nolipall",T,0);
return PLUGIN_CONTINUE;
}