Nigga
Administrator
Dołączył: 18 Mar 2008
Posty: 43
Przeczytał: 0 tematów
Ostrzeżeń: 0/5
|
Wysłany: Wto 14:18, 18 Mar 2008 Temat postu: [CODE] Player Info |
|
|
PLAYER INFO
Ten skrypt pokazuje
informacje dotyczące playera
KOD do Game.cpp
Kod: |
/*=========InfoOGraczu Level & Guild====/playerinfo===*/
void CGame::PlayerCommand_CheckLevel(int iClientH, char* pData, DWORD dwMsgSize)
{/*An Acidx Production - Check Player Level and Guild Last updated July 04, 2005 - Acidx*/
class CStrTok * pStrTok;
short m_iRating;
char * token, cName[11], cTargetName[11], cLevelMessage[256], cTemp[256], seps[] = "= \t\n", cBuff[256];
register int i;
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) {
m_iRating = atoi(token);
}
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)) {
if (m_pClientList[i]->m_cGuildName == "NONE"){
wsprintf(cLevelMessage, "The Player %s is Level %i and is Not a member of any guild", m_pClientList[i]->m_cCharName, m_pClientList[i]->m_iLevel);
}
else {
wsprintf(cLevelMessage, "The Player %s is Level %i and is a member of %s.", m_pClientList[i]->m_cCharName, m_pClientList[i]->m_iLevel, m_pClientList[i]->m_cGuildName);
}
ShowClientMsg(iClientH, cLevelMessage);
}
}
}
|
KOD do Game.h
void PlayerCommand_CheckLevel(int iClientH,char* pData, DWORD dwMsgSize);
Kod: |
Game.cpp
W Funkcji ChatMsgHandler(); dodaj...
if (memcmp(cp, "/playerinfo ", 12) == 0) {
PlayerCommand_CheckLevel(iClientH, cp, dwMsgSize -21);
return;
} |
Post został pochwalony 0 razy
|
|