An essential info site for anyone learning the game. Great community and often very insightful posts.
 
HomeUseful information for Helbreath beginnersPlay, discover, and broadcast your Helbreath moments for free.SearchRulesRegisterLog in
Share
 

 [CODE] Admins on-line

Go down 
AuthorMessage
Krhiz

avatar


[CODE] Admins on-line Empty
PostSubject: [CODE] Admins on-line   [CODE] Admins on-line EmptySat 08 Nov 2014, 1:10 am

Es un código para ver todos los admin en línea.

En Game.CPP agregar:

Code:
/*===========Get Admins==By Acidx====/admins=======*/[size=12][/size]
void CGame::PlayerCommandCheckAdmins(int iClientH)[size=12][/size]
{//An Acidx Production - Last Updated:Aug.29.2006[size=12][/size]
char  cNotifyMessage[256],cNotifyMessage2[256], cGMName[12];[size=12][/size]
int i,x;[size=12][/size]
WORD  * wp;[size=12][/size]
char  * cp;[size=12][/size]
char cBuff[256];[size=12][/size]
cGMName[12];[size=12][/size]
ZeroMemory(cNotifyMessage, sizeof(cNotifyMessage));[size=12][/size]
ZeroMemory(cNotifyMessage2, sizeof(cNotifyMessage2));[size=12][/size]
x = 0;[size=12][/size]
for (i = 0; i < DEF_MAXCLIENTS; i++) [size=12][/size]
 if (m_pClientList[i] != NULL) {[size=12][/size]
[size=12][/size]
 if (m_pClientList[i]->m_iAdminUserLevel > 1) {[size=12][/size]
 wsprintf(cNotifyMessage, "Active Admin: %s", m_pClientList[i]->m_cCharName);[size=12][/size]
 ShowClientMsg(iClientH, cNotifyMessage);[size=12][/size]
 x++;[size=12][/size]
}[size=12][/size]
}[size=12][/size]
 wsprintf(cNotifyMessage2, "%i Admins Are Online", x);[size=12][/size]
 ShowClientMsg(iClientH, cNotifyMessage2);[size=12][/size]
}[size=12][/size]

Dspues en Game.cpp en ChatMsgHandler() agregar:

Code:
/*====Add us Some /Commands here====*/[size=12][/size]
if (memcmp(cp, "/admins", 7) == 0) {[size=12][/size]
  PlayerCommandCheckAdmins(iClientH);[size=12][/size]
  return;[size=12][/size]
 }

Y por ultimo declararlo en Game.h agregar:

Code:
/*====Add us some Declares here pal===*/[size=12][/size]
void PlayerCommandCheckAdmins(int iClientH);


[CODE] Admins on-line 2mpymxj
Back to top Go down
 
[CODE] Admins on-line
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Join Helbreath :: Open Source / Development Corner :: C++-
Jump to: