## 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) !god : FLAG : H (like !heal) g_tyranny : yes USAGE : !god (NAME|SLOT) DESCRIPTION : God mode for the target. If no arg provided it works on self. !check : FLAG : a (like !admintest) g_tyranny : no (since g_tyranny can be changed on the fly it's needed) USAGE : !check (NAME|SLOT) 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. ------------------------- MODIFICATION STARTS HERE src\game\g_shrubbot.c (line 45) **** AFTER {"gib", G_shrubbot_gib, 'g', SCMDF_TYRANNY, "instantly gib a player", "[^3name|slot#^7]"}, **** ADD {"god", G_shrubbot_god, 'H', SCMDF_TYRANNY, "godmode for the player", "[^3name|slot#^7]"}, (line 3400) **** BEFORE /* * This function facilitates the SP define. SP() is similar to CP except that * it prints the message to the server console if ent is not defined. */ **** ADD qboolean G_shrubbot_god(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("god: 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("^/god: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; } if(!_shrubbot_admin_higher(ent, vic)) { SPC("^/god: ^7sorry, but your intended victim has a higher admin" " level than you do.\n"); return qfalse; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/god: ^7player must be on a team to be godmoded\n"); return qfalse; } if(!vic || !vic->client) { SPC(va("^/god: ^7a weird error occured...")); return qfalse; } vic->flags ^= FL_GODMODE; if(vic->flags & FL_GODMODE) AP(va("chat \"^/god: ^7godmode activated for %s\" -1", vic->client->pers.netname)); else AP(va("chat \"^/god: ^7godmode deactivated for %s\" -1", vic->client->pers.netname)); return qtrue; } src\game\g_shrubbot.h : (line 113) **** AFTER qboolean G_shrubbot_gib(gentity_t *ent, int skiparg); **** ADD qboolean G_shrubbot_god(gentity_t *ent, int skiparg); src\game\g_shrubbot.c (line 36) **** AFTER {"cancelvote", G_shrubbot_cancelvote, 'c', 0, "cancel a vote taking place", ""}, **** ADD {"check", G_shrubbot_check, 'a', 0, "checks if a player is godmoded", "[^3name|slot#^7]"}, (line 3400) **** BEFORE /* * This function facilitates the SP define. SP() is similar to CP except that * it prints the message to the server console if ent is not defined. */ **** ADD 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; } src\game\g_shrubbot.h : (line 113) **** AFTER qboolean G_shrubbot_gib(gentity_t *ent, int skiparg); **** ADD qboolean G_shrubbot_check(gentity_t *ent, int skiparg); ------------------------- PERSONAL NOTES qboolean G_shrubbot_lol(gentity_t *ent, int skiparg) { } qboolean G_shrubbot_heal(gentity_t *ent, int skiparg) { } client = targ->client; if ( client ) { if ( client->noclip || client->ps.powerups[PW_INVULNERABLE] ) { return; } } // check for godmode if ( targ->flags & FL_GODMODE ) { return; }