void _printplayerlist (edict_t * self, char *buf, qboolean (*markthis) (edict_t * self, edict_t * other)) { int count = 0, i; edict_t *other; char dummy, tmpbuf[32]; Q_strncatz (buf, " # Name\n", MAX_STRING_CHARS); Q_strncatz (buf, "------------------------------------\n", MAX_STRING_CHARS); for (i = 1; i <= game.maxclients; i++) { other = &g_edicts[i]; if (other->client && other != self && other->inuse) { if (markthis (self, other) == true) dummy = '*'; else dummy = ' '; sprintf (tmpbuf, "%2i %c%s\n", i, dummy, other->client->pers.netname); count++; Q_strncatz (buf, tmpbuf, MAX_STRING_CHARS); } } if (!count) Q_strncatz (buf, "None\n", MAX_STRING_CHARS); Q_strncatz (buf, "\n", MAX_STRING_CHARS); }
void _printplayerlist (edict_t * self, char *buf, qboolean (*markthis) (edict_t * self, edict_t * other)) { int count = 0, i; edict_t *other; char dummy, tmpbuf[32]; Q_strncatz (buf, " # Name\n", MAX_STRING_CHARS); Q_strncatz (buf, "------------------------------------\n", MAX_STRING_CHARS); for (i = 0, other = g_edicts + 1; i < game.maxclients; i++, other++) { if (!other->inuse || !other->client || other->client->pers.mvdspec) continue; if (other == self) continue; if (markthis (self, other) == true) dummy = '*'; else dummy = ' '; sprintf (tmpbuf, "%2i %c%s\n", i, dummy, other->client->pers.netname); count++; Q_strncatz (buf, tmpbuf, MAX_STRING_CHARS); } if (!count) Q_strncatz (buf, "None\n", MAX_STRING_CHARS); Q_strncatz (buf, "\n", MAX_STRING_CHARS); }
void _printplayerlist (edict_t * self, char *buf, qboolean (*markthis) (edict_t * self, edict_t * other)) { int count, i; edict_t *other; char dummy, tmpbuf[128]; count = 0; strcat (buf, " # Name\n"); strcat (buf, "------------------------------------\n"); for (i = 1; i <= game.maxclients; i++) { other = &g_edicts[i]; if (other->client && other != self && other->inuse) { if (markthis (self, other) == true) dummy = '*'; else dummy = ' '; sprintf (tmpbuf, "%2i %c%s", i, dummy, other->client->pers.netname); count++; //just to be sure: tmpbuf[36] = 0; strcat (tmpbuf, "\n"); strcat (buf, tmpbuf); } } if (!count) strcat (buf, "None\n"); strcat (buf, "\n"); }