/whois -1 fix

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7589 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2013-10-11 16:54:35 +00:00
parent e29f9a1368
commit 397759bb44
+7 -11
View File
@@ -1583,19 +1583,15 @@ void cleanplayervotes(playerent *p)
void whois(int *cn)
{
playerent *p = getclient(*cn);
if(!p)
loopv(players) if(players[i] && players[i]->type == ENT_PLAYER && (*cn == -1 || players[i]->clientnum == *cn))
{
conoutf(_("invalid player name"));
return;
playerent *p = players[i];
uint2ip(p->address, ip);
if(m_teammode) conoutf(_("%c0INFO: %c5%s has %d teamkills."), CC, CC, p->name, p->tks);
if(ip[3] != 0 || player1->clientrole==CR_ADMIN)
conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.%d", *cn, colorname(p), ip[0], ip[1], ip[2], ip[3]); // full IP
else conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.x", *cn, colorname(p), ip[0], ip[1], ip[2]); // censored IP
}
uint2ip(p->address, ip);
if(m_teammode) conoutf(_("%c0INFO: %c5%s has %d teamkills."), CC, CC, p->name, p->tks);
if(ip[3] != 0 || player1->clientrole==CR_ADMIN)
conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.%d", *cn, colorname(p), ip[0], ip[1], ip[2], ip[3]); // full IP
else conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.x", *cn, colorname(p), ip[0], ip[1], ip[2]); // censored IP
}
COMMAND(whois, "i");