//Ignores a player by name void Cmd_Ignore_f(edict_t *self) { edict_t *target; char *name; if (gi.argc() < 2) { gi.cprintf(self, PRINT_MEDIUM, "Use ignore <playername>.\n"); return; } if (level.realFramenum < (self->client->resp.ignore_time + 5 * HZ)) { gi.cprintf(self, PRINT_MEDIUM, "Wait 5 seconds before ignoring again.\n"); return; } name = gi.args(); target = LookupPlayer(self, name, false, true); if (!target) { gi.cprintf(self, PRINT_MEDIUM, "\nUse ignorelist to see who can be ignored.\n"); return; } if (target == self) gi.cprintf(self, PRINT_HIGH, "You can't ignore yourself.\n"); else _AddOrDelIgnoreSubject(self, target, false); }
//Ignores a player by number void Cmd_Ignorenum_f (edict_t * self, char *s) { int i; edict_t *target; if (!*s) { gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorenum <playernumber>.\n"); return; } if (level.framenum < (self->client->resp.ignore_time + 50)) { gi.cprintf (self, PRINT_MEDIUM, "Wait 5 seconds before ignoring again.\n"); return; } i = atoi (s); if(i < 1 || i > game.maxclients) { gi.cprintf (self, PRINT_MEDIUM, "\nUsed ignorenum with illegal number.\n"); return; } target = &g_edicts[i]; if (target && target->client && target != self && target->inuse) _AddOrDelIgnoreSubject (self, target, false); else gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorelist to see who can be ignored.\n"); }
//Ignores players by part of the name void Cmd_IgnorePart_f(edict_t *self) { int i, count = 0; edict_t *target; char *name; if (gi.argc() < 2) { gi.cprintf(self, PRINT_MEDIUM, "Use ignorepart <part-of-playername>.\n"); return; } if (level.realFramenum < (self->client->resp.ignore_time + 10 * HZ)) { gi.cprintf(self, PRINT_MEDIUM, "Wait 10 seconds before ignoring again.\n"); return; } name = gi.args(); for (i = 0, target = g_edicts + 1; i < game.maxclients; i++, target++) { if (!target->inuse || !target->client || target == self || target->client->pers.mvdspec) continue; if (strstr(target->client->pers.netname, name)) { _AddOrDelIgnoreSubject(self, target, false); count++; } } if (count == 0) { gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorelist to see who can be ignored.\n"); } }
//Ignores players by part of the name void Cmd_IgnorePart_f (edict_t * self, char *s) { int i; int j; edict_t *target; if (!*s) { gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorepart <part-of-playername>.\n"); return; } if (level.framenum < (self->client->resp.ignore_time + 100)) { gi.cprintf (self, PRINT_MEDIUM, "Wait 10 seconds before ignoring again.\n"); return; } j = 0; for (i = 1; i <= game.maxclients; i++) { target = &g_edicts[i]; if (target && target->client && target != self && (strstr(target->client->pers.netname, s) != 0)) { _AddOrDelIgnoreSubject (self, target, false); j++; } } if (j == 0) { gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorelist to see who can be ignored.\n"); } }
//Ignores a player by number void Cmd_Ignorenum_f (edict_t * self, char *s) { int i; edict_t *target; if (!*s) { gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorenum <playernumber>.\n"); return; } i = atoi (s); if ((i > 0) && i <= game.maxclients) { target = &g_edicts[i]; if (target && target->client && target != self && target->inuse) _AddOrDelIgnoreSubject (self, target, false); else gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorelist to see who can be ignored.\n"); } else gi.cprintf (self, PRINT_MEDIUM, "\nUsed ignorenum with illegal number.\n"); }
//Ignores a player by name void Cmd_Ignore_f (edict_t * self, char *s) { edict_t *target; if (!*s) { gi.cprintf (self, PRINT_MEDIUM, "\nUse ignore <playername>.\n"); return; } target = FindClientByPersName (s); if (target && target != self) { if (level.framenum > (self->client->resp.ignore_time + 50)) _AddOrDelIgnoreSubject (self, target, false); else { gi.cprintf (self, PRINT_MEDIUM, "Wait 5 seconds before ignoring again.\n"); return; } } else gi.cprintf (self, PRINT_MEDIUM, "\nUse ignorelist to see who can be ignored.\n"); }
void _ClrIgnoresOn (edict_t *target) { edict_t *other; int i; for (i = 0, other = g_edicts + 1; i < game.maxclients; i++, other++) { if (!other->client || !other->inuse) continue; if (IsInIgnoreList(other, target)) _AddOrDelIgnoreSubject(other, target, true); } }
void _ClrIgnoresOn (edict_t * target) { edict_t *other; int i; for (i = 1; i <= game.maxclients; i++) { other = &g_edicts[i]; if (other->client && other->inuse) { if (IsInIgnoreList (other, target)) _AddOrDelIgnoreSubject (other, target, true); } } }
//Ignores a player by number void IgnorePlayer(edict_t *self, char *clientNUM) { edict_t *target; if (!*clientNUM) { gi.cprintf (self, PRINT_MEDIUM, "Use ignorenum <playernumber>.\n"); return; } if (level.realFramenum < (self->client->resp.ignore_time + 5 * HZ)) { gi.cprintf (self, PRINT_MEDIUM, "Wait 5 seconds before ignoring again.\n"); return; } target = LookupPlayer(self, clientNUM, true, false); if (!target) { gi.cprintf(self, PRINT_MEDIUM, "\nUse ignorelist to see who can be ignored.\n"); return; } if (target == self) gi.cprintf(self, PRINT_HIGH, "You can't ignore yourself.\n"); else _AddOrDelIgnoreSubject(self, target, false); }