## ETPub PCR alpha hacks (etpub_pcr_ah) ## (C) 2006-2007 PatheticCockroach.com ## This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 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) !freeze and !clip could be used on higher lvl admins... ------------------------- MODIFICATION STARTS HERE g_shrubbot **** REPLACE qboolean G_shrubbot_freeze(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; char *reason; qboolean doAll = qfalse; int count=0; reason = Q_SayConcatArgs(2+skiparg); if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==1) ) doAll = qtrue; if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==0) ) { if(!ent) { SPC("freeze: you are on the console"); return qfalse; } vic=ent; } else { Q_SayArgv(1+skiparg, name, sizeof(name)); if( !Q_stricmp( name, "all" ) && (g_legacyShrub.integer==0) ) doAll = qtrue; if( doAll ) { int it; 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->client->frozen) { count++; vic->client->frozen = qfalse; } } if(count==0) AP("chat \"^/freeze: ^7there was no frozen player\" -1"); else AP(va("chat \"^/freeze: ^7%d player(s) have been unfrozen\" -1", count)); return qtrue; } if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/freeze: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/freeze: ^7player must be on a team"); return qfalse; } vic->client->frozen = !vic->client->frozen; if(vic->client->frozen) { G_AddEvent(vic, EV_GENERAL_SOUND, G_SoundIndex("sound/misc/referee.wav")); AP(va("chat \"^/freeze: ^7%s^7 is now frozen\" -1", vic->client->pers.netname)); CPx(pids[0], va("cp \"%s ^7froze you%s%s\"", (ent?ent->client->pers.netname:"^3SERVER CONSOLE"), (*reason) ? " because:\n" : "", (*reason) ? reason : "")); } else AP(va("chat \"^/freeze: ^7%s^7 has been unfrozen\" -1", vic->client->pers.netname)); return qtrue; } **** WITH qboolean G_shrubbot_freeze(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; char *reason; qboolean doAll = qfalse; int count=0; reason = Q_SayConcatArgs(2+skiparg); if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==1) ) doAll = qtrue; if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==0) ) { if(!ent) { SPC("freeze: you are on the console"); return qfalse; } vic=ent; } else { Q_SayArgv(1+skiparg, name, sizeof(name)); if( !Q_stricmp( name, "all" ) && (g_legacyShrub.integer==0) ) doAll = qtrue; if( doAll ) { int it; for( it = 0; it < level.numConnectedClients; it++ ) { vic = g_entities + level.sortedClients[it]; if( !_shrubbot_admin_higher(ent, vic) || _shrubbot_immutable(ent, vic) || !(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) continue; if(vic->client->frozen) { count++; vic->client->frozen = qfalse; } } if(count==0) AP("chat \"^/freeze: ^7there was no frozen player\" -1"); else AP(va("chat \"^/freeze: ^7%d player(s) have been unfrozen\" -1", count)); return qtrue; } if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/freeze: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; } if(!_shrubbot_admin_higher(ent, vic)) { SPC("^/freeze: ^7sorry, but your intended victim has a higher admin level than you do.\n"); return qfalse; } if(_shrubbot_immutable(ent, vic)) { SPC("^/freeze: ^7sorry, but your intended victim is immune to shrubbot commands"); return qfalse; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/freeze: ^7player must be on a team"); return qfalse; } vic->client->frozen = !vic->client->frozen; if(vic->client->frozen) { G_AddEvent(vic, EV_GENERAL_SOUND, G_SoundIndex("sound/misc/referee.wav")); AP(va("chat \"^/freeze: ^7%s^7 is now frozen\" -1", vic->client->pers.netname)); CPx(pids[0], va("cp \"%s ^7froze you%s%s\"", (ent?ent->client->pers.netname:"^3SERVER CONSOLE"), (*reason) ? " because:\n" : "", (*reason) ? reason : "")); } else AP(va("chat \"^/freeze: ^7%s^7 has been unfrozen\" -1", vic->client->pers.netname)); return qtrue; } **** REPLACE qboolean G_shrubbot_clip(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; qboolean doAll = qfalse; int count=0; if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==1) ) doAll = qtrue; if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==0) ) { if(!ent) { SPC("clip: you are on the console"); return qfalse; } vic=ent; } else { Q_SayArgv(1+skiparg, name, sizeof(name)); if( !Q_stricmp( name, "all" ) && (g_legacyShrub.integer==0) ) doAll = qtrue; if( doAll ) { int it; 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->client->noclip) { count++; vic->client->noclip = qfalse; } } if(count==0) AP("chat \"^/clip: ^7all players are already clipped\" -1"); else AP(va("chat \"^/clip: ^8%d player(s) have been reclipped\" -1", count)); return qtrue; } if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/clip: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/clip: ^7player must be on a team"); return qfalse; } vic->client->noclip = !vic->client->noclip; if(vic->client->noclip) AP(va("chat \"^/clip: ^7%s^7 is now noclipped\" -1", vic->client->pers.netname)); else AP(va("chat \"^/clip: ^7%s^7 is now reclipped\" -1", vic->client->pers.netname)); return qtrue; } **** WITH qboolean G_shrubbot_clip(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; qboolean doAll = qfalse; int count=0; if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==1) ) doAll = qtrue; if( (Q_SayArgc() < 2+skiparg) && (g_legacyShrub.integer==0) ) { if(!ent) { SPC("clip: you are on the console"); return qfalse; } vic=ent; } else { Q_SayArgv(1+skiparg, name, sizeof(name)); if( !Q_stricmp( name, "all" ) && (g_legacyShrub.integer==0) ) doAll = qtrue; if( doAll ) { int it; for( it = 0; it < level.numConnectedClients; it++ ) { vic = g_entities + level.sortedClients[it]; if( !_shrubbot_admin_higher(ent, vic) || _shrubbot_immutable(ent, vic) || !(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) continue; if(vic->client->noclip) { count++; vic->client->noclip = qfalse; } } if(count==0) AP("chat \"^/clip: ^7all players are already clipped\" -1"); else AP(va("chat \"^/clip: ^8%d player(s) have been reclipped\" -1", count)); return qtrue; } if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/clip: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; } if(!_shrubbot_admin_higher(ent, vic)) { SPC("^/clip: ^7sorry, but your intended victim has a higher admin level than you do.\n"); return qfalse; } if(_shrubbot_immutable(ent, vic)) { SPC("^/clip: ^7sorry, but your intended victim is immune to shrubbot commands"); return qfalse; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/clip: ^7player must be on a team"); return qfalse; } vic->client->noclip = !vic->client->noclip; if(vic->client->noclip) AP(va("chat \"^/clip: ^7%s^7 is now noclipped\" -1", vic->client->pers.netname)); else AP(va("chat \"^/clip: ^7%s^7 is now reclipped\" -1", vic->client->pers.netname)); return qtrue; } ------------------------- PERSONAL NOTES if(!_shrubbot_admin_higher(ent, vic)) { SPC("^/god: ^7sorry, but your intended victim has a higher admin" " level than you do.\n"); return qfalse; }