## ETPub PCR alpha hacks (etpub_pcr_ah) ## (C) 2006-2007 PatheticCockroach.com ## This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License ## Derivative works may only be done if they are distributed with their source code. ## ## The original etpub_pcr_ah source and binaries can be found around http://www.patheticcockroach.com/etserver/etpub_pcr.php ## ## Note : ETPub PCR alpha hacks are just small modifications for ETPub (http://www.etpub.org) Changed the behavior of !check !check : FLAG : a (like !admintest) g_tyranny : no (since g_tyranny can be changed on the fly it's needed) USAGE : !check [name|slot|all] DESCRIPTION : Check if the target is godmoded. If no arg provided it works on self. This can be used on anyone, no matter their level or immunity. Use !check all to test all players at once. ------------------------- MODIFICATION STARTS HERE src\game\g_shrubbot.c (line 37) **** REPLACE {"check", G_shrubbot_check, 'a', 0, "checks if a player is godmoded", "[^3name|slot#^7]"}, **** WITH {"check", G_shrubbot_check, 'a', 0, "checks if a player is godmoded", "[^3name|slot#|all^7]"}, (line 3361) **** REPLACE qboolean G_shrubbot_check(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; if(Q_SayArgc() < 2+skiparg) { if(!ent) { SPC("check: you are on the console"); return qfalse; } vic=ent; } else { Q_SayArgv(1+skiparg, name, sizeof(name)); if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/check: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/check: ^7player must be on a team\n"); return qfalse; } if(!vic || !vic->client) { SPC(va("^/check: ^7a weird error occured...")); return qfalse; } if(vic->flags & FL_GODMODE) AP(va("chat \"^/check: ^1!!! ^7%s ^7is ^1godmoded !!!\" -1", vic->client->pers.netname)); else AP(va("chat \"^/check: ^7%s ^7is ^2not godmoded\" -1", vic->client->pers.netname)); return qtrue; } **** WITH qboolean G_shrubbot_check(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; char *netname; int count=0; if(Q_SayArgc() < 2+skiparg) { if(!ent) { SPC("check: you are on the console"); return qfalse; } vic=ent; } else { Q_SayArgv(1+skiparg, name, sizeof(name)); if( !Q_stricmp( name, "all" ) ) { int it; SBP_begin(); SBP(va("^/check : ^7checking all players for god mode\n")); for( it = 0; it < level.numConnectedClients; it++ ) { vic = g_entities + level.sortedClients[it]; if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) continue; if(vic->flags & FL_GODMODE) { count++; netname = vic->client->pers.netname; SBP(va("^dClient ^7%i (%s^7) : ^1god mode detected\n", level.sortedClients[it], netname)); } } if(count==0) AP(va("chat \"^/check: ^2no player is godmoded here\" -1", count)); else AP(va("chat \"^/check: ^1%d players are currently godmoded\" -1", count)); SBP_end(); return qtrue; } if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/check: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/check: ^7player must be on a team"); return qfalse; } if(!vic || !vic->client) { SPC(va("^/check: ^7a weird error occured...")); return qfalse; } if(vic->flags & FL_GODMODE) AP(va("chat \"^/check: ^1!!! ^7%s ^7is ^1godmoded !!!\" -1", vic->client->pers.netname)); else AP(va("chat \"^/check: ^7%s ^7is ^2not godmoded\" -1", vic->client->pers.netname)); return qtrue; }