Gonzza Moderador
Cantidad de envíos : 16 Fecha de inscripción : 11/01/2008
| Tema: [Command] Give Contribution Vie 11 Ene 2008, 17:53 | |
| En Game.cppAgregar : - Código:
-
void CGame::AdminOrder_SetPlayerCont(int iClientH, char *pData, DWORD dwMsgSize) { char seps[] = "= \t\n"; char * token, cBuff[256]; class CStrTok * pStrTok; char * cont; char cNick[20]; char cCont[5]; char notice[100]; int oldcont; int i; if (m_pClientList[iClientH] == NULL) return; if ((dwMsgSize) <= 0) return; if (m_pClientList[iClientH]->m_iAdminUserLevel == 4) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL); return; } ZeroMemory(cBuff, sizeof(cBuff)); memcpy(cBuff, pData, dwMsgSize); pStrTok = new class CStrTok(cBuff, seps); token = pStrTok->pGet(); token = pStrTok->pGet(); if (token == NULL) { delete pStrTok; return; } strcpy(cNick, token); cont = pStrTok->pGet(); if (cont == NULL) { delete pStrTok; return; } strcpy(cCont, cont); for (i = 0; i < DEF_MAXCLIENTS; i++) { if ((m_pClientList[i] != NULL) && (memcmp(m_pClientList[i]->m_cCharName, cNick, strlen(cNick)) == 0)) { oldcont = m_pClientList[i]->m_iContribution; m_pClientList[i]->m_iContribution=atoi(cCont); SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_QUESTCOUNTER, NULL, NULL, NULL, NULL); wsprintf(notice,"Contribuciones fueron cambiadas para el jugador. %s departe de %d para %d.",m_pClientList[iClientH]->m_cCharName,oldcont,atoi(cCont)); ShowNotice(iClientH,notice); } } delete pStrTok; } En la funcion ChatMsgHandlerAgregar : - Código:
-
if (memcmp(cp, "/setcont ", 9) == 0) { AdminOrder_SetPlayerCont(iClientH, cp, dwMsgSize - 21); return; } En Game.hAgregar : - Código:
-
void AdminOrder_SetPlayerCont(int iClientH, char *pData, DWORD dwMsgSize); | |
|