//Plugin By [OLA] Death To --> #include <core> #include <console> #include <string> #include <admin> #include <adminlib> //FILE WHERE ADMIN NAMES ACCESS AND IMMUNITY IS KEPT new File[MAX_TEXT_LENGTH] = "admin.cfg"; new STRING_VERSION[MAX_DATA_LENGTH] = "1.0"; new iTimer_Death; new iGlow; new iStrobe; new bool:bbombing = true; new Ro = 0; new Vo = 0; new Rp = 0; /////////////////////////////////////////////////////////////////////////// // Register Info Stuff // /////////////////////////////////////////////////////////////////////////// public plugin_init() { plugin_registerinfo("Admin", "Admin", STRING_VERSION); plugin_registercmd("admin_who","who",ACCESS_ALL); plugin_registercmd("admin_vote_gravity","admin_vote_gravity",ACCESS_ALL); plugin_registercmd("say","handsay",ACCESS_ALL); plugin_registercmd("admin_listmaps","admin_listmaps",ACCESS_ALL); plugin_registercmd("admin_nextmap","admin_nextmap",ACCESS_ALL); plugin_registercmd("admin_timeleft","admin_timeleft",ACCESS_ALL); plugin_registercmd("admin_userlist","admin_userlist",ACCESS_ALL); plugin_registercmd("admin_vote_kick","admin_vote_kick",ACCESS_ALL); plugin_registercmd("admin_vote_map","admin_vote_map",ACCESS_ALL); plugin_registercmd("admin_vote_bomb","admin_vote_bomb",ACCESS_ALL); return PLUGIN_CONTINUE; } /////////////////////////////////////////////////////////////////////////// // FUNCTIONS // /////////////////////////////////////////////////////////////////////////// public admin_vote_bomb(HLCommand,HLData,HLUserName,UserIndex) { new Target[MAX_TEXT_LENGTH]; new Text[MAX_TEXT_LENGTH]; new PW[MAX_TEXT_LENGTH]; new AI[MAX_TEXT_LENGTH]; new A[MAX_TEXT_LENGTH]; new I[MAX_TEXT_LENGTH]; new Str[MAX_TEXT_LENGTH]; new i; new l; new e = 0; new d = 1; new immune = 0; new Index; new Id; new Wonid; new Team; new Dead; for (i=1; d==1; i++) { if (readfile("a.cfg",Str,i,MAX_TEXT_LENGTH)==1) { l = i; d = 1; } else { d = 0; } } convert_string(HLData,Target,MAX_TEXT_LENGTH); if (vote_allowed()!=1) { selfmessage("Vote not allowed at this time."); } else if ((vote_allowed()==1) && (bbombing == false)) { selfmessage("You will have to wait before you can use bombing again"); } else if ((vote_allowed()==1) && (bbombing == true) && (strcasecmp(Target,"")==0)) { selfmessage("bomb <wonid or name>: name can be parts of users name"); } else if ((vote_allowed()==1) && (bbombing == true) && (strcasecmp(Target,"")!=0) && (check_user(Target)==0)) { snprintf(Text,MAX_TEXT_LENGTH,"Unknown Name: %s",Target); selfmessage(Text); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile("a.cfg",Str,i,MAX_TEXT_LENGTH); strbreak(Str,PW,AI,MAX_TEXT_LENGTH); strbreak(AI,A,I,MAX_TEXT_LENGTH); e = strtonum(PW); if ((e==Wonid) && (strcasecmp(I,"1")==0)) { immune = 1; } } } if ((vote_allowed()==1) && (bbombing==true) && (strcasecmp(Target, "")!=0) && (check_user(Target)!=0) && (Wonid==0)) { selfmessage("Cant run bomb on bots"); } else if ((vote_allowed()==1) && (bbombing==true) && (strcasecmp(Target, "")!=0) && (check_user(Target)!=0) && (Wonid!=0) && (immune==1)) { snprintf(Text,MAX_TEXT_LENGTH,"Player Has Immunity: %s",Target); selfmessage(Text); } else if ((vote_allowed()==1) && (bbombing==true) && (strcasecmp(Target, "")!=0) && (check_user(Target)!=0) && (Wonid!=0) && (immune!=1) && (Dead==1)) { selfmessage("You Cant Make A Dead Person A Bomb"); } else if ((vote_allowed()==1) && (bbombing==true) && (strcasecmp(Target, "")!=0) && (check_user(Target)!=0) && (Wonid!=0) && (immune!=1) && (Dead!=1)) { snprintf(Text,MAX_TEXT_LENGTH,"Turn %s into a bomb?",Target); vote(Text,"Yes","No","bombvote",Target); } } public bombvote(WinningOption,HLUser,VoteCount,UserCount) { new Target[MAX_TEXT_LENGTH]; new Text[MAX_TEXT_LENGTH]; new strNumber[MAX_TEXT_LENGTH]; new Red = random(256); new Green = random(256); new Blue = random(256); convert_string(HLUser,Target,MAX_TEXT_LENGTH); if (Rp == 0) { if (WinningOption == 1) { if (VoteCount >= 50*UserCount/100) { snprintf(Text, MAX_TEXT_LENGTH, "You Activated Bomb On %s With A %d Second Fuse.", Target,8); selfmessage(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s Has Been Made A Bomb With A %d Second Fuse.", Target,8); say(Text); snprintf(Text, MAX_TEXT_LENGTH, "Everybody Run When He Goes Off Anyone Near Will Die Too."); say(Text); execclient(Target,"speak ^"warning _comma detonation device activated^""); glow(Target, Red, Green, Blue); iTimer_Death = set_timer("timer",1,8,Target); } else { numtostr(50*UserCount/100,strNumber); snprintf(Text, MAX_TEXT_LENGTH, "Bomb vote succeeded, but not enough votes for bomb (needed %s)",strNumber); say(Text); } } else { say("Bomb Vote Failed"); } } else { Rp = 0; } } public plugin_connect(HLUserName, HLIP, UserIndex) { new Name[MAX_NAME_LENGTH]; new Text[MAX_TEXT_LENGTH]; new CurrentMap[MAX_NAME_LENGTH]; new NextMap[MAX_NAME_LENGTH]; new players = playercount(); new oneplay = getteamcount(1); new twoplay = getteamcount(2); new thrplay = getteamcount(3); new frplay = getteamcount(4); new Seconds = timeleft(0)/60; new conmsg[MAX_TEXT_LENGTH]; new strSeconds[MAX_NAME_LENGTH]; new strMinutes[MAX_NAME_LENGTH]; new Server[MAX_TEXT_LENGTH]; getstrvar("hostname",Server,MAX_TEXT_LENGTH); new R = random(256); new G = random(256); new B = random(256); new Minutes = (timeleft(0) - (Seconds * 60)); nextmap(NextMap,MAX_NAME_LENGTH); currentmap(CurrentMap,MAX_NAME_LENGTH); convert_string(HLUserName, Name, MAX_NAME_LENGTH); consgreet("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>"); snprintf(Text,MAX_TEXT_LENGTH," Welcome to %s",Server); consgreet(Text); consgreet("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>"); snprintf(Text,MAX_TEXT_LENGTH,"Current map is: %s",CurrentMap); consgreet(Text); consgreet(" "); if (getvar("mp_timelimit")==0) { consgreet("Map has no timelimit:"); consgreet("To Change map do: admin_vote_map mapname : in console"); } else if (Seconds<0) { consgreet("Map is about to change to the next one..."); } else { numtostr(Seconds, strSeconds); numtostr(Minutes, strMinutes); addstr(conmsg,"Time Remaining On Map: "); addstr(conmsg,strSeconds); addstr(conmsg," minutes "); addstr(conmsg,strMinutes); addstr(conmsg," seconds."); consgreet(conmsg); } consgreet(" "); snprintf(Text,MAX_TEXT_LENGTH,"Next map is: %s",NextMap); consgreet(Text); consgreet(" "); snprintf(Text,MAX_TEXT_LENGTH,"Current ammount of players: %d",players); consgreet(Text); consgreet(" "); snprintf(Text,MAX_TEXT_LENGTH,"Team 1 has: %d players",oneplay); consgreet(Text); consgreet(" "); snprintf(Text,MAX_TEXT_LENGTH,"Team 2 has: %d players",twoplay); consgreet(Text); if (thrplay>=1) { consgreet(" "); snprintf(Text,MAX_TEXT_LENGTH,"Team 3 has: %d players",thrplay); consgreet(Text); } if (frplay>=1) { consgreet(" "); snprintf(Text,MAX_TEXT_LENGTH,"Team 4 has: %d players",frplay); consgreet(Text); } consgreet("<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>"); consgreet(" Now just wait to get connected..."); consgreet(" "); consgreet(" "); consgreet(" "); snprintf(Text, MAX_TEXT_LENGTH, " %s ^n Has Joined %s", Name,Server); centersay(Text, 8, R, G, B); return PLUGIN_HANDLED; } public plugin_disconnect(HLUserName, UserIndex) { new Name[MAX_NAME_LENGTH]; new Text[MAX_TEXT_LENGTH]; new Server[MAX_TEXT_LENGTH]; getstrvar("hostname",Server,MAX_TEXT_LENGTH); new R = random(256); new G = random(256); new B = random(256); convert_string(HLUserName,Name,MAX_NAME_LENGTH); snprintf(Text, MAX_TEXT_LENGTH, " %s ^n Has Left %s", Name,Server); centersay(Text, 8, R, G, B); return PLUGIN_HANDLED; } public admin_vote_map(HLCommand,HLData,HLUserName,UserIndex) { new Command[MAX_COMMAND_LENGTH]; new Data[MAX_DATA_LENGTH]; new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; if (vote_allowed()!=1) { selfmessage( "Vote not allowed at this time."); return PLUGIN_HANDLED; } convert_string(HLCommand,Command,MAX_COMMAND_LENGTH); convert_string(HLData,Data,MAX_DATA_LENGTH); convert_string(HLUserName,User,MAX_NAME_LENGTH); if (valid_map(Data) == 1) { snprintf(Text, MAX_TEXT_LENGTH, "Change map to %s?", Data); log(Text); vote(Text,"Yes","No","HandleMapVote",Data); } else { selfmessage("Bad map name"); selfmessage(Data); } return PLUGIN_HANDLED; } /* Handle a map vote's results. */ public HandleMapVote(WinningOption,HLMap,VoteCount,UserCount) { new strNumber[MAX_NUMBER_LENGTH]; new Text[MAX_TEXT_LENGTH]; new VoteMap[MAX_DATA_LENGTH]; convert_string(HLMap,VoteMap,MAX_DATA_LENGTH); new sTimelimit[10]; getstrvar("mp_timelimit", sTimelimit, 10); if (WinningOption == 1) { new Ratio = getvar("map_ratio"); if (VoteCount >= Ratio*UserCount/100) { snprintf(Text, MAX_TEXT_LENGTH, "Changing map to %s due to vote.", VoteMap); say(Text); exec("mp_timelimit 1"); set_serverinfo( "config_mp_timelimit", sTimelimit ); changelevel(VoteMap); } else { numtostr(Ratio*UserCount/100,strNumber); snprintf(Text, MAX_TEXT_LENGTH, "Map vote succeeded, but not enough votes for change (needed %s)", strNumber); say(Text); } } else { say("Map vote failed."); } } public admin_vote_kick(HLCommand,HLData,HLUserName,UserIndex) { new Command[MAX_COMMAND_LENGTH]; new Data[MAX_DATA_LENGTH]; new Text[MAX_TEXT_LENGTH]; new User[MAX_NAME_LENGTH]; new Str[MAX_NAME_LENGTH]; new line = 0; new WONID; new strWONID[MAX_NUMBER_LENGTH]; if (vote_allowed()!=1) { selfmessage( "Vote not allowed at this time."); return PLUGIN_HANDLED; } convert_string(HLCommand,Command,MAX_COMMAND_LENGTH); convert_string(HLData,Data,MAX_DATA_LENGTH); convert_string(HLUserName,User,MAX_NAME_LENGTH); if (check_user(Data) == 1) { new real_user[MAX_NAME_LENGTH]; get_username(Data,real_user,MAX_NAME_LENGTH); say_command(User,Command,Data); if(check_immunity(real_user)!=0) { snprintf(Text, MAX_TEXT_LENGTH, "Laf. You can't kick %s, you silly bear.", real_user); say(Text); } else { snprintf(Text, MAX_TEXT_LENGTH, "Kick %s?", real_user); if(getvar("sv_lan")==1) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_vote_kick on %s,User,real_user"); messageex(User,Text,print_chat); writefile("userlog.cfg",Text,line); vote(Text,"Yes","No","HandleKickVote",real_user); } else { get_userWONID(real_user,WONID); numtostr(WONID,strWONID); vote(Text,"Yes","No","HandleKickVote",strWONID); } } } else { selfmessage("Unrecognized user name "); selfmessage(Data); } return PLUGIN_HANDLED; } /* Handle a kick vote's results. */ public HandleKickVote(WinningOption,HLUser,VoteCount,UserCount) { new strNumber[MAX_NUMBER_LENGTH]; new Text[MAX_TEXT_LENGTH]; new VoteUser[MAX_DATA_LENGTH]; convert_string(HLUser,VoteUser,MAX_DATA_LENGTH); if (WinningOption == 1) { new Ratio = getvar("kick_ratio"); if (VoteCount >= Ratio*UserCount/100) { snprintf(Text, MAX_TEXT_LENGTH, "%s was kicked due to a vote.", VoteUser); say(Text); message(VoteUser,"You have been kicked due to a vote."); kick(VoteUser); } else { numtostr(Ratio*UserCount/100,strNumber); snprintf(Text, MAX_TEXT_LENGTH, "Kick vote succeeded, but not enough votes for kick (needed %s)",strNumber); say(Text); } } else { say("Kick vote failed."); } } public admin_userlist(HLCommand,HLData,HLUserName,UserIndex) { new Data[MAX_DATA_LENGTH]; convert_string(HLData,Data,MAX_DATA_LENGTH); userlist(Data); return PLUGIN_HANDLED; } public admin_timeleft(HLCommand,HLData,HLUserName,UserIndex) { timeleft(); return PLUGIN_HANDLED; } public admin_nextmap(HLCommand,HLData,HLUserName,UserIndex) { new strDummy[1]; nextmap(strDummy,0); return PLUGIN_HANDLED; } public admin_listmaps(HLCommand,HLData,HLUserName,UserIndex) { new curmap[100]; selfmessage("The maps on the mapcycle are:"); list_maps(); selfmessage("and the current map is:"); currentmap(curmap,100); selfmessage(curmap); return PLUGIN_HANDLED; } public gravvote(WinningOption,HLData,VoteCount,UserCount) { if (Ro == 0) { if ((WinningOption == 1) && (getvar("sv_gravity") == 100)) { say("Winning Option Was #1"); say("<SERVER> Gravity stayed the same at 100"); } else if ((WinningOption == 1) && (getvar("sv_gravity") != 100)) { exec("sv_gravity 100"); say("Winning Option Was #1"); say("<SERVER> Gravity Changed To 100"); } if ((WinningOption == 2) && (getvar("sv_gravity") == 200)) { say("Winning Option Was #2"); say("<SERVER> Gravity stayed the same at 200"); } else if ((WinningOption == 2) && (getvar("sv_gravity") != 200)) { exec("sv_gravity 200"); say("Winning Option Was #2"); say("<SERVER> Gravity Changed To 200"); } if ((WinningOption == 3) && (getvar("sv_gravity") == 400)) { say("Winning Option Was #3"); say("<SERVER> Gravity stayed the same at 400"); } else if ((WinningOption == 3) && (getvar("sv_gravity") != 400)) { exec("sv_gravity 400"); say("Winning Option Was #3"); say("<SERVER> Gravity Changed To 400"); } if ((WinningOption == 4) && (getvar("sv_gravity") == 600)) { say("Winning Option Was #4"); say("<SERVER> Gravity stayed the same at 600"); } else if ((WinningOption == 4) && (getvar("sv_gravity") != 600)) { exec("sv_gravity 600"); say("Winning Option Was #4"); say("<SERVER> Gravity Changed To 600"); } if ((WinningOption == 5) && (getvar("sv_gravity") == 800)) { say("Winning Option Was #5"); say("<SERVER> Gravity stayed the same at 800"); } else if ((WinningOption == 5) && (getvar("sv_gravity") != 800)) { exec("sv_gravity 800"); say("Winning Option Was #5"); say("<SERVER> Gravity Changed To 800"); } } else { Ro = 0; } } public strobe(Timer,Repeat,HLUserName,C) { new color[MAX_TEXT_LENGTH]; new U[MAX_TEXT_LENGTH]; new Data[MAX_TEXT_LENGTH]; convert_string(C,Data,MAX_TEXT_LENGTH); strbreak(Data,color,U,MAX_TEXT_LENGTH); if (getvar("admin_fun_mode")!=1) { exec("admin_fun_mode 1"); } else if (strcasecmp(color,"red")==0) { glow(U,255,0,0); } else if (strcasecmp(color,"orange")==0) { glow(U,255,128,64); } else if (strcasecmp(color,"yellow")==0) { glow(U,255,255,0); } else if (strcasecmp(color,"banana")==0) { glow(U,128,255,0); } else if (strcasecmp(color,"green")==0) { glow(U,0,255,0); } else if (strcasecmp(color,"teal")==0) { glow(U,0,255,192); } else if (strcasecmp(color,"turquoise")==0) { glow(U,0,255,255); } else if (strcasecmp(color,"sky")==0) { glow(U,0,128,255); } else if (strcasecmp(color,"blue")==0) { glow(U,0,0,255); } else if (strcasecmp(color,"purple")==0) { glow(U,192,0,255); } else if (strcasecmp(color,"pink")==0) { glow(U,255,0,128); } else if (strcasecmp(color,"white")==0) { glow(U,255,255,255); } else if (strcasecmp(color,"gray")==0) { glow(U,128,128,128); } else if (strcasecmp(color,"brown")==0) { glow(U,128,64,0); } else if (strcasecmp(color,"maroon")==0) { glow(U,128,64,64); } } public off(Timer,Repeat,HLUserName,C) { new U[MAX_TEXT_LENGTH]; convert_string(C,U,MAX_TEXT_LENGTH); glow(U,0,0,0); } public wait(Timer,Repeat,HLUserName,C) { new c[MAX_TEXT_LENGTH]; convert_string(C,c,MAX_TEXT_LENGTH); if (Repeat-1==0) { iStrobe = set_timer("off",2,99999,c); } } public handsay(HLCommand,HLData,HLUserName,UserIndex) { new data[MAX_TEXT_LENGTH]; new msg[MAX_TEXT_LENGTH]; new Str[MAX_TEXT_LENGTH]; new AI[MAX_TEXT_LENGTH]; new Target[MAX_TEXT_LENGTH]; new PWonid[MAX_TEXT_LENGTH]; new U[MAX_TEXT_LENGTH]; new gl[MAX_TEXT_LENGTH]; new color[MAX_TEXT_LENGTH]; new Text[MAX_TEXT_LENGTH]; new i; new d = 1; new l; convert_string(HLUserName,U,MAX_TEXT_LENGTH); convert_string(HLData,data,MAX_TEXT_LENGTH); strstripquotes(data); strbreak(data,gl,color,MAX_TEXT_LENGTH); strbreak(data,msg,Target,MAX_TEXT_LENGTH); if ((strcasecmp(gl,"glow")==0) || (strcasecmp(data,"vote_gravity")==0)) { for (i=1; d==1; i++) { if (readfile(File,Str,i,MAX_TEXT_LENGTH)==1) { l = i; d = 1; } else { d = 0; } } for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,PWonid,AI,MAX_TEXT_LENGTH); if (check_user(PWonid)!=0) { get_username(PWonid,Str,MAX_TEXT_LENGTH); if (strcasecmp(Str,U)==0) { d = 1; } } } } numtostr((getvar("sv_gravity")),Str); if (strcasecmp(gl,"glow")==0) { if (getvar("admin_fun_mode")!=1) { exec("admin_fun_mode 1"); } else if (strcasecmp(color,"red")==0) { glow(U,255,0,0); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"orange")==0) { glow(U,255,128,64); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"yellow")==0) { glow(U,255,255,0); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"banana")==0) { glow(U,128,255,0); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"green")==0) { glow(U,0,255,0); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"teal")==0) { glow(U,0,255,192); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"turquoise")==0) { glow(U,0,255,255); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"sky")==0) { glow(U,0,128,255); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"blue")==0) { glow(U,0,0,255); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"purple")==0) { glow(U,192,0,255); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"pink")==0) { glow(U,255,0,128); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"white")==0) { glow(U,255,255,255); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"gray")==0) { glow(U,128,128,128); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"brown")==0) { glow(U,128,64,0); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"maroon")==0) { glow(U,128,64,64); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing %s",U,color); say(Text); } else if (strcasecmp(color,"strobe red")==0) { snprintf(AI,MAX_TEXT_LENGTH,"red %s",U); iGlow = set_timer("strobe",2,99999,AI); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing red",U); say(Text); } else if (strcasecmp(color,"strobe orange")==0) { snprintf(AI,MAX_TEXT_LENGTH,"orange %s",U); iGlow = set_timer("strobe",2,99999,"orange"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing orange",U); say(Text); } else if (strcasecmp(color,"strobe yellow")==0) { snprintf(AI,MAX_TEXT_LENGTH,"yellow %s",U); iGlow = set_timer("strobe",2,99999,"yellow"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing yellow",U); say(Text); } else if (strcasecmp(color,"strobe banana")==0) { snprintf(AI,MAX_TEXT_LENGTH,"banana %s",U); iGlow = set_timer("strobe",2,99999,"banana"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing banana",U); say(Text); } else if (strcasecmp(color,"strobe green")==0) { snprintf(AI,MAX_TEXT_LENGTH,"green %s",U); iGlow = set_timer("strobe",2,99999,"green"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing green",U); say(Text); } else if (strcasecmp(color,"strobe teal")==0) { snprintf(AI,MAX_TEXT_LENGTH,"teal %s",U); iGlow = set_timer("strobe",2,99999,"teal"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing teal",U); say(Text); } else if (strcasecmp(color,"strobe turquoise")==0) { snprintf(AI,MAX_TEXT_LENGTH,"turquoise %s",U); iGlow = set_timer("strobe",2,99999,"turquoise"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing turquoise",U); say(Text); } else if (strcasecmp(color,"strobe sky")==0) { snprintf(AI,MAX_TEXT_LENGTH,"sky %s",U); iGlow = set_timer("strobe",2,99999,"sky"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing sky",U); say(Text); } else if (strcasecmp(color,"strobe blue")==0) { snprintf(AI,MAX_TEXT_LENGTH,"blue %s",U); iGlow = set_timer("strobe",2,99999,"blue"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing blue",U); say(Text); } else if (strcasecmp(color,"strobe purple")==0) { snprintf(AI,MAX_TEXT_LENGTH,"purple %s",U); iGlow = set_timer("strobe",2,99999,"purple"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing purple",U); say(Text); } else if (strcasecmp(color,"strobe pink")==0) { snprintf(AI,MAX_TEXT_LENGTH,"pink %s",U); iGlow = set_timer("strobe",2,99999,"pink"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing pink",U); say(Text); } else if (strcasecmp(color,"strobe white")==0) { snprintf(AI,MAX_TEXT_LENGTH,"white %s",U); iGlow = set_timer("strobe",2,99999,"white"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing white",U); say(Text); } else if (strcasecmp(color,"strobe gray")==0) { snprintf(AI,MAX_TEXT_LENGTH,"gray %s",U); iGlow = set_timer("strobe",2,99999,"gray"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing gray",U); say(Text); } else if (strcasecmp(color,"strobe brown")==0) { snprintf(AI,MAX_TEXT_LENGTH,"brown %s",U); iGlow = set_timer("strobe",2,99999,"brown"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is glowing brown",U); say(Text); } else if (strcasecmp(color,"strobe maroon")==0) { snprintf(AI,MAX_TEXT_LENGTH,"maroon %s",U); iGlow = set_timer("strobe",2,99999,"maroon"); set_timer("wait",1,1,U); snprintf(Text,MAX_TEXT_LENGTH,"%s is strobing maroon",U); say(Text); } else if (strcasecmp(color,"off")==0) { glow(U,0,0,0); snprintf(Text,MAX_TEXT_LENGTH,"%s has had glowing removed",U); say(Text); kill_timer(iGlow); kill_timer(iStrobe); } else { say("Unrecognized Color"); } } if ((strcasecmp(data,"vote_gravity") == 0) && (vote_allowed()!=1)) { say("Vote Not Allowed At This Time."); } else if ((strcasecmp(data,"vote_gravity") == 0) && (vote_allowed()==1)) { Vo = 1; msg = ""; addstr(msg,"Gravity is at: "); addstr(msg,Str); say(msg); vote("Change Gravity To?","100","200","400","600","800","gravvote",""); } if ((strcasecmp(data,"cancelgrav") == 0) && (d==1) && (Vo == 1)) { say("Gravity vote cancled"); Ro = 1; Vo = 0; } else if ((strcasecmp(data,"cancelgrav") == 0) && (d!=1) && (Vo == 0)) { say("You are not authorized to do that"); } else if ((strcasecmp(data,"cancelgrav") == 0) && (d!=1) && (Vo == 1)) { say("You are not authorized to do that"); } else if ((strcasecmp(data,"cancelgrav") == 0) && (d==1) && (Vo == 0)) { say("No gravity vote in progress"); } if ((strcasecmp(data,"gravity") == 0)) { msg = ""; addstr(msg,"<Response> Gravity is at: "); addstr(msg,Str); say(msg); } } public admin_vote_gravity(HLCommand,HLData,HLUserName,UserIndex) { new msg[MAX_TEXT_LENGTH]; new Str[MAX_TEXT_LENGTH]; numtostr((getvar("sv_gravity")),Str); if (vote_allowed()!=1) { selfmessage("Vote Not Allowed At This Time."); } else if (vote_allowed()==1) { Vo = 1; msg = ""; addstr(msg,"Gravity is at: "); addstr(msg,Str); say(msg); vote("Change Gravity To?","100","200","400","600","800","gravvote",""); } } public who(HLCommand,HLData,HLUserName,UserIndex) { new Str[MAX_TEXT_LENGTH]; new Wonid[MAX_TEXT_LENGTH]; new AI[MAX_TEXT_LENGTH]; new msg[MAX_TEXT_LENGTH]; new i; new d = 1; new l; for (i=1; d==1; i++) { if (readfile(File,Str,i,MAX_TEXT_LENGTH)==1) { l = i; d = 1; } else { d = 0; } } for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Wonid,AI,MAX_TEXT_LENGTH); if (check_user(Wonid)!=0) { get_username(Wonid,Wonid,MAX_TEXT_LENGTH); snprintf(msg,MAX_TEXT_LENGTH,"%s is ADMIN currently on server",Wonid); selfmessage(msg); } } } addstr(strBegin[],strEnd[]) { new i=0; new Length = strlen(strEnd); new j; while(strBegin[i]!=0) i++; for(j=0;j<Length;j++) strBegin[i+j]=strEnd[j]; strBegin[i+j] = NULL_CHAR; } public plugin_command(HLCommand,HLData,HLUserName,UserIndex) { new C[MAX_TEXT_LENGTH]; new Data[MAX_TEXT_LENGTH]; new Str[MAX_TEXT_LENGTH]; new St[MAX_TEXT_LENGTH]; new Name[MAX_TEXT_LENGTH]; new maxplayers = maxplayercount(); new Index, Id; new Wonid, Team; new Dead, i; new match = 0; new d = 1; new Target[MAX_TEXT_LENGTH]; new Num[MAX_TEXT_LENGTH]; new m[MAX_TEXT_LENGTH]; new Text[MAX_TEXT_LENGTH]; new U[MAX_NAME_LENGTH]; new msg[MAX_NAME_LENGTH]; new n, l, abcdefgh=0, abcdefg=0, abcdef=0, abcde=0, abcd=0, abc=0, ab=0, a=0; new R = random(256); new G = random(256); new B = random(256); new X = 0; new Y = 0; new Z = 0; new line, e = 0, b,c=0; convert_string(HLCommand,C,MAX_TEXT_LENGTH); convert_string(HLData,Data,MAX_TEXT_LENGTH); convert_string(HLUserName,U,MAX_NAME_LENGTH); if (strstrx(Data,"admin_")!=0) { for (i=1; d==1; i++) { if (readfile(File,Str,i,MAX_TEXT_LENGTH)==1) { l = i; d = 1; } else { d = 0; } } playerinfo(UserIndex,Name,MAX_TEXT_LENGTH,Id,Wonid,Team,Dead); numtostr(Wonid,St); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Target,m,MAX_TEXT_LENGTH); strbreak(m,Num,msg,MAX_TEXT_LENGTH); X = strtonum(Num); if (strcasecmp(Target,St)==0) { match = 1; if ((X<512) && (X>=256)) { c = 1; X = X - 256; } if ((X<256) && (X>=128)) { abcdefgh = 8; X = X - 128; } if ((X<128) && (X>=64)) { abcdefg = 7; X = X - 64; } if ((X<64) && (X>=32)) { abcdef = 6; X = X - 32; } if ((X<32) && (X>=16)) { abcde = 5; X = X - 16; } if ((X<16) && (X>=8)) { abcd = 4; X = X - 8; } if ((X<8) && (X>=4)) { abc = 3; X = X - 4; } if ((X<4) && (X>=2)) { ab = 2; X = X - 2; } if ((X<2) && (X>=1)) { a = 1; X = X - 1; } } } } convert_string(HLData,Target,MAX_TEXT_LENGTH); if (match==1) { if ((strcasecmp(C,"admin_slap")==0) && (abcd==4)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_slap <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_slap on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been slapped by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_slap on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); slap(Target); } } else if ((strcasecmp(C,"admin_slap")==0) && (abcd!=4)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_kick",C)==0) && (abcd==4)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_kick <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_kick on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been kicked by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_kick on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); kick(Target); } } else if ((strcasecmp(C,"admin_kick")==0) && (abcd!=4)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_slay",C)==0) && (abcd==4)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_slay <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_slay on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been slayed by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_slay on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); slay(Target); } } else if ((strcasecmp(C,"admin_slay")==0) && (abcd!=4)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_slayall",C)==0) && (abcd==4)) { for (i=1;i<=maxplayers;i++) { if (playerinfo(i,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead)==1) { for (b=1;b<=l;b++) { readfile(File,Str,b,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } if ((d==1) && (Wonid!=0)) { d = 0; } else if ((d!=1) && (Wonid!=0)) { snprintf(Text, MAX_TEXT_LENGTH, "You have been slayed by an admin"); messageex(Target,Text,print_chat); slay(Target); } } } readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_slayall", U); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_slayall")==0) && (abcd!=4)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_gravity",C)==0) && (abc==3)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <#>: admin_gravity <#>"); } else if (strcasecmp(Target, "") != 0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); addstr(m,"sv_gravity "); addstr(m,Target); exec(m); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_gravity", U); log(Text); writefile("userlog.cfg",Text,line); } } else if ((strcasecmp(C,"admin_gravity")==0) && (abcd!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_godmode",C)==0) && (abcde==5)) { strbreak(Data,Target,Num,MAX_TEXT_LENGTH); if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_godmode <name> <1 or 0>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_godmode on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); n = strtonum(Num); godmode(Target,n); snprintf(Text, MAX_TEXT_LENGTH, "%s has godmode set to %d",U,n); say(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_godmode on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } } else if ((strcasecmp(C,"admin_godmode")==0) && (abcde!=5)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_godall",C)==0) && (abcde==5)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <1 or 0>: admin_godall <1 or 0>"); } else if (strcasecmp(Target, "") != 0) { for (i=1;i<=maxplayers;i++) { if (playerinfo(i,Data,MAX_NAME_LENGTH,Id,Wonid,Team,Dead)==1) { if ((check_immunity(Data)==1) && (Wonid==0)) { } else if ((check_immunity(Data)!=1) && (Wonid!=0)) { n = strtonum(Target); godmode(Data,n); } } } } readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "Everyone has godmode set to %s",Target); say(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_godall %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_godall")==0) && (abcde!=5)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_noclip",C)==0) && (abcde==5)) { strbreak(Data,Target,Num,MAX_TEXT_LENGTH); if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_noclip <name> <1 or 0>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_noclip on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); n = strtonum(Num); noclip(Target,n); snprintf(Text, MAX_TEXT_LENGTH, "%s has noclip set to %d",U,n); say(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_noclip on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } } else if ((strcasecmp(C,"admin_noclip")==0) && (abcde!=5)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_noclipall",C)==0) && (abcde==5)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <1 or 0>: admin_noclipall <1 or 0>"); } else if (strcasecmp(Target, "") != 0) { for (i=1;i<=maxplayers;i++) { if (playerinfo(i,Data,MAX_NAME_LENGTH,Id,Wonid,Team,Dead)==1) { if ((check_immunity(Data)==1) && (Wonid==0)) { } else if ((check_immunity(Data)!=1) && (Wonid!=0)) { n = strtonum(Target); noclip(Data,n); } } } } readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "Everyone has noclip set to %s",Target); say(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_noclipall %s", U,Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_noclipall")==0) && (abcde!=5)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_csay",C)==0) && (a==1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); centersay(Target,10,R,G,B); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_csay %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_csay")==0) && (a!=1)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_tsay",C)==0) && (a==1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); typesay(Target,10,R,G,B); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_tsay %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_tsay")==0) && (a!=1)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_chat",C)==0) && (a==1)) { snprintf(Text, MAX_TEXT_LENGTH, "(Admin) %s: %s", U, Target); for(i=1; i<=maxplayers; i++) { if (playerinfo(i,Name,MAX_TEXT_LENGTH,Id,Wonid,Team,Dead)==1) { d = 1; for (i=1; d==1; i++) { if (readfile(File,Str,i,MAX_TEXT_LENGTH)==1) { readfile(File,Str,i,MAX_TEXT_LENGTH); if ((Wonid==strtonum(Str)) || (access(16384,Name)!=0)) { messageex(Name, Text, print_chat); } } else { d = 0; } } } } readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_chat %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_chat")==0) && (a!=1)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_map",C)==0) && (abc==3)) { if (valid_map(Target)==1) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "Map has been changed to %s by an admin",Target); say(Text); changelevel(Target); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_map %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else { selfmessage("Bad map name"); selfmessage(Target); } } else if ((strcasecmp(C,"admin_map")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_psay",C)==0) && (a==1)) { strbreak(Data,Target,msg,MAX_TEXT_LENGTH); if (strcasecmp(Target, "") == 0) { consgreet("Need: admin_psay <name> <msg>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_TEXT_LENGTH,Id,Wonid,Team,Dead); } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_psay to bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "<Private: %s> %s",U,msg); messageex(Target,Text,print_chat); messageex(U,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_psay %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } } else if ((strcasecmp(C,"admin_psay")==0) && (a!=1)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_ssay",C)==0) && (a==1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); say(Target); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_ssay %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_ssay")==0) && (a!=1)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_vsay",C)==0) && (a==1)) { if (vote_allowed()!=1) { selfmessage( "Vote not allowed at this time."); } else if (vote_allowed()==1) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); vote(Target,"Yes","No","vsay", Target); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_vsay %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } } else if ((strcasecmp(C,"admin_vsay")==0) && (a!=1)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_userorigin",C)==0) && (abc==3)) { if (check_user(Data)!=0) { if (get_userorigin(Data, X, Y, Z)==1) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "Success. X %i, Y %i, Z %i", X, Y, Z); selfmessage(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_userorigin on %s", U, Data); log(Text); writefile("userlog.cfg",Text,line); } else { selfmessage("Failed."); } } else { selfmessage("Unrecognized player: "); selfmessage(Data); } } else if ((strcasecmp(C,"admin_userorigin")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_ct",C)==0) || (strcasecmp("admin_t",C)==0) || (strcasecmp("admin_red",C)==0) || (strcasecmp("admin_blue",C)==0) || (strcasecmp("admin_yellow",C)==0) || (strcasecmp("admin_green",C)==0) && (ab==2)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run this on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1)) { if (strcasecmp(C,"admin_ct")==0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been moved to a different team by an admin"); messageex(Target,Text,print_chat); execclient(Target, "chooseteam;menuselect 2;menuselect 3"); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_ct on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if (strcasecmp(C,"admin_t")==0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been moved to a different team by an admin"); messageex(Target,Text,print_chat); execclient(Target, "chooseteam;menuselect 1;menuselect 3"); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_t on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if (strcasecmp(C,"admin_red")==0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been moved to a different team by an admin"); messageex(Target,Text,print_chat); execclient(Target, "jointeam 2"); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_red on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if (strcasecmp(C,"admin_blue")==0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been moved to a different team by an admin"); messageex(Target,Text,print_chat); execclient(Target, "jointeam 1"); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_blue on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if (strcasecmp(C,"admin_yellow")==0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been moved to a different team by an admin"); messageex(Target,Text,print_chat); execclient(Target, "jointeam 3"); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_yellow on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if (strcasecmp(C,"admin_green")==0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been moved to a different team by an admin"); messageex(Target,Text,print_chat); execclient(Target, "jointeam 4"); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_green on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } } } else if ((strcasecmp("admin_ct",C)==0) || (strcasecmp("admin_t",C)==0) || (strcasecmp("admin_red",C)==0) || (strcasecmp("admin_blue",C)==0) || (strcasecmp("admin_yellow",C)==0) || (strcasecmp("admin_green",C)==0) && (ab!=2)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_bomb",C)==0) && (abcd==4)) { Str = "admin_bombs 1"; if (strcasecmp(Str, "admin_bombs 0") == 0) { selfmessage("Sorry Bombing Isnt Enabled Right Now"); } else if ((strcasecmp(Str, "admin_bombs 0") != 0) && (bbombing == false)) { selfmessage("You will have to wait before you can use bombing again"); } else if ((strcasecmp(Str, "admin_bombs 0") != 0) && (bbombing == true) && (strcasecmp(Target, "") == 0)) { consgreet("Need <wonid or name>: admin_bomb <wonid or name>"); } else if ((strcasecmp(Str, "admin_bombs 0") != 0) && (bbombing == true) && (strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Str, "admin_bombs 0") != 0) && (bbombing == true) && (strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_bomb on bots"); } else if ((strcasecmp(Str, "admin_bombs 0") != 0) && (bbombing == true) && (strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Person Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Str, "admin_bombs 0") != 0) && (bbombing == true) && (strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (Dead==1) && (d!=1)) { selfmessage("You Cant Make A Dead Person A Bomb"); } else if ((strcasecmp(Str, "admin_bombs 0") != 0) && (bbombing == true) && (strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (Dead!=1) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been made a bomb by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "You Activated Bomb On %s With A %d Second Fuse.", Target,8); selfmessage(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s Has Been Made A Bomb With A %d Second Fuse.", Target,8); say(Text); snprintf(Text, MAX_TEXT_LENGTH, "Everybody Run When He Goes Off Anyone Near Will Die Too."); say(Text); execclient(Target,"speak ^"warning _comma detonation device activated^""); glow(Target, R, G, B); snprintf(msg,MAX_TEXT_LENGTH,"%s used admin_bomb %s",U,Target); log(msg); writefile("userlog.cfg",msg,line); iTimer_Death = set_timer("timer",1,8,Target); } } else if ((strcasecmp(C,"admin_bomb")==0) && (abcd!=4)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_teleport",C)==0) && (abc==3)) { strbreak(Data,Target,Str,MAX_TEXT_LENGTH); strbreak(Str,St,Num,MAX_TEXT_LENGTH); strbreak(Num,m,C,MAX_TEXT_LENGTH); if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_teleport <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,Text,MAX_TEXT_LENGTH); strbreak(Text,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_teleport on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1)) { X = strtonum(St); Y = strtonum(m); Z = strtonum(C); teleport(Target,X,Y,Z); readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been teleported by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_teleport on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } } else if ((strcasecmp(C,"admin_teleport")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp(C,"admin_glow")==0) && (abc==3)) { strbreak(Data,Target,Str,MAX_TEXT_LENGTH); strbreak(Str,St,Num,MAX_TEXT_LENGTH); strbreak(Num,m,Text,MAX_TEXT_LENGTH); if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_glow <name> <red> <green> <blue>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_glow on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (strcasecmp(Target,U)==0)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_glow on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); X = strtonum(St); Y = strtonum(m); Z = strtonum(Text); glow(Target,X,Y,Z); readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); } } else if ((strcasecmp(C,"admin_glow")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_friendlyfire",C)==0) && (abcdef==6)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "mp_friendlyfire %s", Target); exec(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_friendlyfire %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_friendlyfire")==0) && (abcdef!=6)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_teamplay",C)==0) && (abcdef==6)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "mp_teamplay %s", Target); exec(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_teamplay %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_teamplay")==0) && (abcdef!=6)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_timelimit",C)==0) && (abcdef==6)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "mp_timelimit %s", Target); exec(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_timelimit %s", U, Target); log(Text); } else if ((strcasecmp(C,"admin_timelimit")==0) && (abcdef!=6)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_fraglimit",C)==0) && (abcdef==6)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "mp_fraglimit %s", Target); exec(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_fraglimit %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_fraglimit")==0) && (abcdef!=6)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_pass",C)==0) && (abcdefg==7)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "sv_password %s", Target); exec(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_pass %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_pass")==0) && (abcdefg!=7)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_nopass",C)==0) && (abcdefg==7)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); exec("sv_password ^"^""); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_nopass", U); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_nopass")==0) && (abcdefg!=7)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_hostname",C)==0) && (abcdefg==7)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "hostname %s", Target); exec(Text); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_hostname %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_hostname")==0) && (abcdefg!=7)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_rcon",C)==0) && (abcdefgh==8)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); exec(Target); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_rcon %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_rcon")==0) && (abcdefgh!=8)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_ban",C)==0) && (abcdefg==7)) { strbreak(Data,Target,Num,MAX_TEXT_LENGTH); if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_ban <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_ban on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_ban on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); numtostr(Wonid,Target); snprintf(Text, MAX_TEXT_LENGTH, "banid %d %s kick",Num,Target); exec(Text); } } else if ((strcasecmp(C,"admin_ban")==0) && (abcdefg!=7)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_unban",C)==0) && (abcdefg==7)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_unban <wonid>"); } else if (strcasecmp(Target, "") != 0) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_unban on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); numtostr(Wonid,Target); snprintf(Text, MAX_TEXT_LENGTH, "removeid %s",Target); exec(Text); } } else if ((strcasecmp(C,"admin_unban")==0) && (abcdefg!=7)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp(C,"admin_execclient")==0) && (abcdefgh==8)) { strbreak(Data,Target,Num,MAX_TEXT_LENGTH); if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_execclient <name> <command>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Text,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Text,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_execclient on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_execclient %s %s", U, Target,Num); log(Text); writefile("userlog.cfg",Text,line); execclient(Target,Num); } } else if ((strcasecmp(C,"admin_execclient")==0) && (abcdefgh!=8)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_execall",C)==0) && (abcdefgh==8)) { for (i=1;i<=maxplayers;i++) { if (playerinfo(i,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead)==1) { for (b=1;b<=l;b++) { readfile(File,Str,b,MAX_TEXT_LENGTH); strbreak(Str,C,m,MAX_TEXT_LENGTH); strbreak(m,msg,Text,MAX_TEXT_LENGTH); e = strtonum(C); if ((e==Wonid) && (strcasecmp(Text,"1")==0)) { d = 1; } } if ((d==1) && (Wonid!=0)) { d = 0; } else if ((d!=1) && (Wonid!=0)) { execclient(Target,Data); } } } readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_execall %s", U,Data); log(Text); writefile("userlog.cfg",Text,line); C = "admin_execall"; } else if ((strcasecmp(C,"admin_execall")==0) && (abcdefgh!=8)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_stack",C)==0) && (c==1)) { get_userorigin(U,X,Y,Z); for (i=1;i<=maxplayers;i++) { if (playerinfo(i,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead)==1) { for (b=1;b<=l;b++) { readfile(File,Str,b,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } if ((d==1) && (Wonid!=0)) { d = 0; } else if ((d!=1) && (Wonid!=0) && (Dead==0) && (UserIndex!=i)) { snprintf(Text, MAX_TEXT_LENGTH, "You have been stacked by an admin"); messageex(Target,Text,print_chat); Z = Z+75; teleport(Target,X,Y,Z); } } } readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_stack", U); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_stack")==0) && (c!=1)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_speakall",C)==0) && (abc==3)) { for (i=1;i<=maxplayers;i++) { if (playerinfo(i,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead)==1) { if (Wonid!=0) { snprintf(Text,MAX_TEXT_LENGTH,"speak ^"%s^"",Data); execclient(Target,Text); } } } readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_speakall %s", U,Data); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_speakall")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_shutdown",C)==0) && (abcdefgh==8)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); set_timer("kleen_shutdown", 1, 31); plugin_exec("admin_ssay", "Server is shutting down..."); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_shutdown", U); log(Text); writefile("userlog.cfg",Text,line); } else if ((strcasecmp(C,"admin_shutdown")==0) && (abcdefgh!=8)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_pissed",C)==0) && (abcd==4)) { strbreak(Data,Target,Num,MAX_TEXT_LENGTH); if ((strcasecmp(Target, "") == 0) || (strcasecmp(Num, "") == 0)) { consgreet("Need <name>: admin_piseed <name> <on or off>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,St,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(St,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid == 0)) { selfmessage("Cant run admin_pissed on bots"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1) && (strcasecmp(Num, "on") == 0)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_pissed on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); messageex(Target, "You Have Been Imobilized And Put On Crack.", print_chat); messageex(Target, "Dont F\/ck With The Admins.", print_chat); msg = ""; addstr(msg, "Executed Command On: "); addstr(msg, Target); selfmessage(msg); execclient(Target, "cl_forwardspeed 0"); execclient(Target, "clear"); execclient(Target, "cl_sidespeed 0"); execclient(Target, "clear"); execclient(Target, "cl_upspeed 0"); execclient(Target, "clear"); execclient(Target, "cl_backspeed 0"); execclient(Target, "clear"); execclient(Target, "m_yaw 1000"); execclient(Target, "clear"); execclient(Target, "m_pitch 1000"); execclient(Target, "clear"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (Wonid != 0) && (d!=1) && (strcasecmp(Num, "off") == 0)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_pissed on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); messageex(Target, "You Have Been Deimobilized And Been Rid Of Crack.", print_chat); messageex(Target, "Dont F\/ck With The Admins.", print_chat); msg = ""; addstr(msg, "Executed Command On: "); addstr(msg, Target); selfmessage(msg); execclient(Target, "cl_forwardspeed 600"); execclient(Target, "clear"); execclient(Target, "cl_sidespeed 600"); execclient(Target, "clear"); execclient(Target, "cl_upspeed 600"); execclient(Target, "clear"); execclient(Target, "cl_backspeed 600"); execclient(Target, "clear"); execclient(Target, "m_yaw .02"); execclient(Target, "clear"); execclient(Target, "m_pitch .02"); execclient(Target, "clear"); } } else if ((strcasecmp(C,"admin_pissed")==0) && (abcd!=4)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_check",C)==0) && (abcdefgh==8)) { d = 1; for (i=1; d==1; i++) { if (readfile("userlog.cfg",Str,i,MAX_TEXT_LENGTH)==1) { l = i; d = 1; } else { d = 0; } } l = l+1; numtostr(l,Str); writefile("number.cfg",Str,1); } else if ((strcasecmp(C,"admin_check")==0) && (abcdefgh!=8)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp(C,"admin_send")==0) && (abc==3)) { strbreak(Data,Target,msg,MAX_TEXT_LENGTH); if ((strcasecmp(Target, "") == 0) || (strcasecmp(msg, "") == 0)) { consgreet("Need <name>: admin_send <stay name> <send name>"); } else if ((strcasecmp(Target, "") != 0) && (strcasecmp(msg, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player 1:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (strcasecmp(msg, "") != 0) && (check_user(Target) != 0) && (check_user(msg) == 0)) { selfmessage("Unrecognized Player 2:"); selfmessage(msg); } else if ((strcasecmp(Target, "") != 0) && (strcasecmp(msg, "") != 0) && (check_user(Target) != 0) && (check_user(msg) != 0)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been sent by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_send on %s %s", U,Target, msg); log(Text); writefile("userlog.cfg",Text,line); get_userorigin(Target, X,Y,Z); teleport(msg,X,Y,Z); } } else if ((strcasecmp(C,"admin_send")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_freeze",C)==0) && (abc==3)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_freeze <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been froozen by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_freeze on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); get_userorigin(Target,X,Y,Z); teleport(Target,X,Y,Z-30); } } else if ((strcasecmp(C,"admin_freeze")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } if ((strcasecmp("admin_unfreeze",C)==0) && (abc==3)) { if (strcasecmp(Target, "") == 0) { consgreet("Need <name>: admin_unfreeze <name>"); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) == 0)) { selfmessage("Unrecognized Player:"); selfmessage(Target); } else { get_userindex(Target, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,Id,Wonid,Team,Dead); for (i=1;i<=l;i++) { readfile(File,Str,i,MAX_TEXT_LENGTH); strbreak(Str,Data,m,MAX_TEXT_LENGTH); strbreak(m,msg,Num,MAX_TEXT_LENGTH); e = strtonum(Data); if ((e==Wonid) && (strcasecmp(Num,"1")==0)) { d = 1; } } } if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (d==1)) { selfmessage("Player Has Immunity:"); selfmessage(Target); } else if ((strcasecmp(Target, "") != 0) && (check_user(Target) != 0) && (d!=1)) { readfile("number.cfg",Str,1,MAX_TEXT_LENGTH); line = strtonum(Str) + 1; numtostr(line,Str); writefile("number.cfg",Str,1); snprintf(Text, MAX_TEXT_LENGTH, "You have been unfroozen by an admin"); messageex(Target,Text,print_chat); snprintf(Text, MAX_TEXT_LENGTH, "%s used admin_unfreeze on %s", U, Target); log(Text); writefile("userlog.cfg",Text,line); get_userorigin(Target,X,Y,Z); teleport(Target,X,Y,Z+30); } } else if ((strcasecmp(C,"admin_unfreeze")==0) && (abc!=3)) { selfmessage("You are not authorized to do this"); } } } public kleen_shutdown(Timer, Repeat, HLUser, HLParam) { new Text[MAX_TEXT_LENGTH]; snprintf(Text, MAX_TEXT_LENGTH, "Shutting down server in..^n %d", Repeat-1); plugin_exec("admin_csay", Text); if (Repeat-1 == 0) { kill_timer(Timer); plugin_exec("admin_say", "Shuttin'er down...."); exec("exit"); } return PLUGIN_HANDLED; } public timer(Timer, Repeat, HLUserName, Bomb) { new Guy[MAX_NAME_LENGTH]; new Name[MAX_NAME_LENGTH]; new Target[MAX_TEXT_LENGTH]; new Text[MAX_TEXT_LENGTH]; new msg[MAX_TEXT_LENGTH]; new Index; new ID; new Team; new Dead; new WONID; new Red = random(256); new Green = random(256); new Blue = random(256); new i; new X; new Y; new Z; new x; new y; new z; new maxplayers = maxplayercount(); convert_string(Bomb,Guy,MAX_NAME_LENGTH); if (Repeat-1 == 0) { get_userindex(Guy, Index); playerinfo(Index,Name,MAX_NAME_LENGTH,ID,WONID,Team,Dead); snprintf(Text, MAX_TEXT_LENGTH, "%s Has Been Blow Up.",Name); typesay(Text, 1, Red, Green, Blue); bbombing = true; glow(Name,0,0,0); if ((playerinfo(Index,Name,MAX_NAME_LENGTH,ID,WONID,Team,Dead) == 1) && (Dead == 1)) { get_userindex(Guy, Index); playerinfo(Index,Name,MAX_NAME_LENGTH,ID,WONID,Team,Dead); kill_timer(iTimer_Death); msg = ""; addstr(msg,"Oh well, "); addstr(msg, Name); addstr(msg," died before he could blow up."); glow(Name,0,0,0); bbombing = true; say(msg); } for (i=1; i<=maxplayers; i++) { strinit(Target); if ((playerinfo(i,Target,MAX_NAME_LENGTH,ID,WONID,Team,Dead) == 1) && (Dead == 0)) { get_userorigin(Target, X, Y, Z); get_userorigin(Guy, x, y, z); if ((X-x < 500) && (X-x > (-500)) && (Y-y < 500) && (Y-y > (-500)) && (Z-z < 500) && (Z-z > (-500))) { slay(Target); snprintf(Text, MAX_TEXT_LENGTH, "%s Has Been Caught In The Explosion.",Target); say(Text); } } } } else { get_userindex(Guy, Index); playerinfo(Index,Target,MAX_NAME_LENGTH,ID,WONID,Team,Dead); snprintf(Text, MAX_TEXT_LENGTH, "%s Will Explode In %d",Target,Repeat-1); typesay(Text, 1, Red, Green, Blue); bbombing = false; if ((playerinfo(Index,Target,MAX_NAME_LENGTH,ID,WONID,Team,Dead) == 1) && (Dead == 1)) { bbombing = true; kill_timer(iTimer_Death); msg = ""; addstr(msg,"Oh well, "); addstr(msg,Name); addstr(msg," died before he could blow up."); say(msg); } } } public vsay(WinningOption,HLData,VoteCount,UserCount) { new Data[MAX_DATA_LENGTH]; new Text[MAX_TEXT_LENGTH]; convert_string(HLData,Data,MAX_DATA_LENGTH); snprintf(Text, MAX_TEXT_LENGTH, "^"%s^": Option #%i won with %i / %i votes.", Data, WinningOption, VoteCount, UserCount); say(Text); }