Code: Select all
void CGame::AdminOrder_CheckStats(int iClientH, char *pData,DWORD dwMsgSize)
{
char cStatMessage[256];
char seps[] = "= \t\n";
char cBuff[256];
class CStrTok * pStrTok;
char * token, cName[11], cTargetName[11];
register int i;
if (m_pClientList[iClientH] == NULL) return;
if (m_pClientList[iClientH]->m_iAdminUserLevel < 1) {
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
return;
}
if ((dwMsgSize) <= 0) return;
ZeroMemory(cTargetName, sizeof(cTargetName));
ZeroMemory(cBuff, sizeof(cBuff));
memcpy(cBuff, pData, dwMsgSize);
pStrTok = new class CStrTok(cBuff, seps);
token = pStrTok->pGet();
token = pStrTok->pGet();
if (token != NULL) {
ZeroMemory(cName, sizeof(cName));
strcpy(cName, token);
}
else {
ZeroMemory(cName, sizeof(cName));
strcpy(cName, "null");
}
token = pStrTok->pGet();
if (token == NULL) {
token = "null";
}
if (cName != NULL) {
token = cName;
if (strlen(token) > 10)
memcpy(cTargetName, token, 10);
else memcpy(cTargetName, token, strlen(token));
for (i = 1; i < DEF_MAXCLIENTS; i++)
if ((m_pClientList[i] != NULL) && (memcmp(m_pClientList[i]->m_cCharName, cTargetName, 10) == 0)) {
// Level, Exp, Str, Int, Vit, Dex, Mag, Charisma, Location, Luck, Ek
ZeroMemory(cStatMessage, sizeof(cStatMessage));
wsprintf(cStatMessage, "Level:%d Exp:%d Str:%d Dex:%d Vit:%d Int:%d Mag:%d Chr:%d Map:%d EK:%d Luck:%d",m_pClientList[i]->m_iLevel,m_pClientList[i]->m_iExp, m_pClientList[i]->m_iStr, m_pClientList[i]->m_iDex, m_pClientList[i]->m_iVit, m_pClientList[i]->m_iInt,m_pClientList[i]->m_iMag, m_pClientList[i]->m_iCharisma, m_pClientList[i]->m_cLocation, m_pClientList[i]->m_iEnemyKillCount, m_pClientList[i]->m_iLuck);
ShowClientMsg(iClientH, cStatMessage);
}
}
}
Should work i dont take any credit for code at all i jsut modified it
Just remember if you shake it more then 3 times your playing with it.