alin2894 14 Posted June 30, 2015 Share Posted June 30, 2015 Hello m2dev, Does anyone know how to do to see how many players are online all channel? I understand that we must alter the function from cmd_gm.cpp, this exactly: ACMD(do_who) { int iTotal; int * paiEmpireUserCount; int iLocal; DESC_MANAGER::instance().GetUserCount(iTotal, &paiEmpireUserCount, iLocal); ch->ChatPacket(CHAT_TYPE_INFO, "Total [%d] %d / %d / %d (this server %d)", iTotal, paiEmpireUserCount[1], paiEmpireUserCount[2], paiEmpireUserCount[3], iLocal); } class user_func { public: LPCHARACTER m_ch; static int count; static char str[128]; static int str_len; user_func() : m_ch(NULL) {} void initialize(LPCHARACTER ch) { m_ch = ch; str_len = 0; count = 0; str[0] = '\0'; } void operator () (LPDESC d) { if (!d->GetCharacter()) return; int len = snprintf(str + str_len, sizeof(str) - str_len, "%-16s ", d->GetCharacter()->GetName()); if (len < 0 || len >= (int) sizeof(str) - str_len) len = (sizeof(str) - str_len) - 1; str_len += len; ++count; if (!(count % 4)) { m_ch->ChatPacket(CHAT_TYPE_INFO, str); str[0] = '\0'; str_len = 0; } } }; int user_func::count = 0; char user_func::str[128] = { 0, }; int user_func::str_len = 0; Would be amended to show how many players are online on all channels?Kind regards. Link to comment Share on other sites More sharing options...
alin2894 14 Posted July 2, 2015 Author Share Posted July 2, 2015 up. Link to comment Share on other sites More sharing options...
alin2894 14 Posted July 4, 2015 Author Share Posted July 4, 2015 up Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now