ich hab heute mal kurz was dran gemacht, krass oder. ich glaube, die bombenträgererkennung könnte jetzt funktionieren
Code:
/* Gh0sTbUsTeR Mode by Devilzero & Rinde
Coded by Rinde, Idee & Basecode from Devilzero
Special THX to: www.adminmod.de
*/
#include <adminlib>
#define ACCESS_GB 8192
#define ACCESS_CONSOLE 131072
new STRING_VERSION[MAX_DATA_LENGTH]= "0.5b 1.11.02 19:59";
new GBMode;
new Bombcarrier;
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");
say_command(UserName,Command,Data);
centersay("Gh0sTbUsTeR Mode startet in 10 Sekunden.",10, 10, 255, 255);
} 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);
} else {
snprintf(Data,MAX_TEXT_LENGTH,"^"admin_gbmode^" is ^"%i^"",GBMode);
selfmessage(Data);
}
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 && (Bombcarrier != -UserIndex || strcmp(Command,"weapon_c4") != 0)) {
Noclipaction(UserIndex,0);
messageex(UserName,"Diese Waffe darfst du im Gh0sTbUsTeR Mode nicht benutzen.",print_chat);
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public HandleSay(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new UserName[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
strstripquotes(Data);
if (GBMode == 1 && strcasestr(Data,"iwantplant") != -1 && UserIndex == Bombcarrier && playerinfo(UserIndex,UserName,MAX_NAME_LENGTH) == 1) {
noclip(UserName, 0);
Bombcarrier = -UserIndex;
execclient(UserName,"weapon_c4");
}
return PLUGIN_CONTINUE;
}
public logd_playeraction(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new sUserIndex[MAX_NUMBER_LENGTH];
new UserName[MAX_NAME_LENGTH];
new UserIndex2;
if(GBMode == 1) {
strsep(Data," ",sUserIndex,MAX_NUMBER_LENGTH,Data,MAX_DATA_LENGTH);
UserIndex2 = strtonum(sUserIndex);
if(strcmp(Data,"Spawned_With_The_Bomb") == 0 || strcmp(Data,"Got_The_Bomb") == 0) Bombcarrier = UserIndex2;
else if(strcmp(Data,"Dropped_The_Bomb") == 0 || strcmp(Data,"Planted_The_Bomb") == 0) {
playerinfo(UserIndex2,UserName,MAX_NAME_LENGTH);
if(Bombcarrier == -UserIndex2) {
Noclipaction(UserIndex2,1);
} else {
Noclipaction(UserIndex2,0);
}
Bombcarrier = 0;
}
}
return PLUGIN_HANDLED;
}
public logd_entergame(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
if(GBMode == 1) {
convert_string(HLData,Data,MAX_DATA_LENGTH);
Noclipaction(strtonum(Data),1);
}
return PLUGIN_HANDLED;
}
public logd_roundstart(HLCommand,HLData,HLUserName,UserIndex) {
new i;
if(GBMode == 1) {
for(i=1;i<=maxplayercount();i++) {
Noclipaction(i,1);
}
}
return PLUGIN_HANDLED;
}
Noclipaction(UserIndex,Noclip = 1) {
new UserName[MAX_NAME_LENGTH];
new Dead;
if(playerinfo(UserIndex,UserName, MAX_NAME_LENGTH,_,_,_,Dead) == 1 && Dead == 0) {
if(Noclip == 1) {
noclip(UserName, 1);
messageex(UserName,"Gh0sTbUsTeR Mode ist aktiviert.",print_tty);
}
execclient(UserName,"weapon_knife");
}
}
public HandleBuy(HLCommand,HLData,HLUserName,UserIndex) {
new UserName[MAX_NAME_LENGTH];
convert_string(HLUserName,UserName,MAX_NAME_LENGTH);
if(GBMode == 1) {
execclient(UserName,"menuselect 10");
messageex(UserName,"Du darfst keine Waffen kaufen,^nwenn Gh0sTbUsTeR Mode aktiviert ist.",print_center);
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
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: An|aus");
plugin_registercmd("buy","HandleBuy",ACCESS_ALL);
plugin_registercmd("buyequip","HandleBuy",ACCESS_ALL);
plugin_registerhelp("say_team",ACCESS_ALL,"say_team iwantplant: Schaltet den Noclip-Modus aus, bis die Bombe gelegt oder fallengelassen wird.");
exec("logd_reg 51 admin_command logd_gb_entergame");
plugin_registercmd("logd_gb_entergame", "logd_entergame", ACCESS_CONSOLE);
exec("logd_reg 60 admin_command logd_gb_playeraction");
plugin_registercmd("logd_gb_playeraction", "logd_playeraction", ACCESS_CONSOLE);
exec("logd_reg 62 admin_command logd_gb_roundstart");
plugin_registercmd("logd_gb_roundstart", "logd_roundstart", ACCESS_CONSOLE);
if(get_vaultnumdata("logd_gb",GBMode) == 0) set_vaultnumdata("logd_gb",GBMode);
return PLUGIN_CONTINUE;
}