## 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 : FLAG : Z (like !pause) g_tyranny : no USAGE : !freeze [name|slot|all] [reason] DESCRIPTION : Freeze/unfreeze a player. If done on all it will unfreeze all. If no arg provided it works on self. ------------------------- MODIFICATION STARTS HERE src\game\g_local.h (line 921) **** AFTER // the rest of the structure is private to game clientPersistant_t pers; clientSession_t sess; qboolean noclip; **** ADD qboolean frozen; src\game\g_active.c (line 576) **** REPLACE // OSP - dead players are frozen too, in a timeout if((client->ps.pm_flags & PMF_LIMBO) && level.match_pause != PAUSE_NONE) { client->ps.pm_type = PM_FREEZE; } else if( client->noclip ) { client->ps.pm_type = PM_NOCLIP; } **** WITH // OSP - dead players are frozen too, in a timeout // PatheticCockroach : added client->frozen for !freeze if( ((client->ps.pm_flags & PMF_LIMBO) && level.match_pause != PAUSE_NONE) || client->frozen ) { client->ps.pm_type = PM_FREEZE; } else if( client->noclip ) { client->ps.pm_type = PM_NOCLIP; } (line 1488) **** BEFORE else if ( client->noclip ) { client->ps.pm_type = PM_NOCLIP; } **** ADD else if ( client->frozen ) { client->ps.pm_type = PM_FREEZE; } src\game\g_shrubbot.c (line 45) **** AFTER {"flinga", G_shrubbot_fling, 'L', SCMDF_TYRANNY, "fling all players", ""}, **** ADD {"freeze", G_shrubbot_freeze, 'Z', 0, "freeze/unfreeze a player, if done on all it will unfreeze all", SHRUB_PCR_ARGR}, (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_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; } src\game\g_shrubbot.h : (line 113) **** AFTER qboolean G_shrubbot_check(gentity_t *ent, int skiparg); **** ADD qboolean G_shrubbot_freeze(gentity_t *ent, int skiparg); ------------------------- PERSONAL NOTES client->ps.pm_type = PM_FREEZE;