## 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) ## ## This !finger function was inspired by CHAOS's - http://etpub.org/e107_plugins/forum/forum_viewtopic.php?20695 This modification also removes a debugging string (EventHandling: 0 and 1 when opening limbo screen) !finger : FLAG : f g_tyranny : no USAGE : !finger (NAME|SLOT) DESCRIPTION : gives lots of info about the player (slot, IP, GUID, lvl) ------------------------- MODIFICATION STARTS HERE src\cgame\cg_newDraw.c : (line 744) **** REPLACE CG_Printf("EventHandling: %d\n", type); **** WITH //CG_Printf("EventHandling: %d\n", type); src\game\g_shrubbot.c : (line 2261) **** REPLACE qboolean G_shrubbot_finger(gentity_t *ent, int skiparg) { int i, l = 0; char *lname = NULL; int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; if(Q_SayArgc() < 2+skiparg) { SPC("^/finger usage: ^7!finger [name|slot#]"); return qfalse; } Q_SayArgv(1+skiparg, name, sizeof(name)); if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/finger: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; // Dens: if someone is incog, feel free to show level 0 if(!_shrubbot_admin_higher(ent, vic) && !G_shrubbot_permission(vic, SBF_INCOGNITO)) { SPC("^/finger: ^7sorry, but your intended victim has a higher admin" " level than you do"); return qfalse; } if(_shrubbot_immutable(ent, vic)) { SPC("^/finger: ^7sorry, but your intended victim is immune to shrubbot commands"); return qfalse; } // Get the level number for(i=0; g_shrubbot_admins[i]; i++) { if(!Q_stricmp(g_shrubbot_admins[i]->guid, vic->client->sess.guid)) { if(G_shrubbot_permission(vic, SBF_INCOGNITO)) { break; } l = g_shrubbot_admins[i]->level; break; } } // Get the label for the level number for(i=0; g_shrubbot_levels[i]; i++) { if (g_shrubbot_levels[i]->level == l) { lname = g_shrubbot_levels[i]->name; break; } } AP(va("chat \"^/finger: ^7%s^7 is a level %d user %s%s^7%s\" -1", vic->client->pers.netname, l, (lname) ? "(" : "", (lname) ? lname : "", (lname) ? ")" : "")); return qtrue; } **** WITH qboolean G_shrubbot_finger(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS]; gentity_t *vic; char userinfo[MAX_INFO_STRING]; char *guid, *ip, *netname; char *lname = NULL; int l = 0; int i; if(Q_SayArgc() < 2+skiparg) { SPC("^/finger usage: ^7!finger [name|slot#]\n"); return qfalse; } Q_SayArgv(1+skiparg, name, sizeof(name)); if(ClientNumbersFromString(name, pids) != 1) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/finger: ^7%s\n", err)); return qfalse; } vic = &g_entities[pids[0]]; if(!_shrubbot_admin_higher(ent, vic)) { SPC("^/finger: ^7sorry, but your intended victim has a higher admin" " level than you do."); return qfalse; } if(_shrubbot_immutable(ent, vic)) { SPC("^/finger: ^7sorry, but your intended victim is immune to shrubbot commands"); return qfalse; } // Get the level number for(i=0; g_shrubbot_admins[i]; i++) { if(!Q_stricmp(g_shrubbot_admins[i]->guid, vic->client->sess.guid)) { l = g_shrubbot_admins[i]->level; break; } } // Get the label for the level number for(i=0; g_shrubbot_levels[i]; i++) { if (g_shrubbot_levels[i]->level == l) { lname = g_shrubbot_levels[i]->name; break; } } trap_GetUserinfo(pids[0], userinfo, sizeof(userinfo)); guid = Info_ValueForKey(userinfo, "cl_guid"); ip = Info_ValueForKey(userinfo, "ip"); netname = vic->client->pers.netname; SBP_begin(); SBP(va("^/finger : ^7showing information for %s\n", netname)); SBP(va("^dClient : ^2%i\n", pids[0])); SBP(va("^dGUID : ^2%s\n", guid)); SBP(va("^dIP : ^2%s\n", ip)); SBP(va("^dAdmin : ^2%i (^7%s^2)\n", l, lname)); SBP_end(); return qtrue; }