void CGame::AdminOrder_SummonGuild(int iClientH, char *pData, DWORD dwMsgSize)
{
char seps[] = "= \t\n";
char * token, * cp, cBuff[256], cMapName[11], char cGuildName[20];
WORD *wp;
int pX, pY, i;
class CStrTok * pStrTok;
DWORD dwGoldCount;
if (m_pClientList[iClientH] == NULL) return;
if ((dwMsgSize) <= 0) return;
if (m_pClientList[iClientH]->m_iAdminUserLevel < m_iAdminLevelSummonGuild) {
// Admin user levelÀÌ ³·¾Æ¼ ÀÌ ±â´ÉÀ» »ç¿ëÇÒ ¼ö ¾ø´Ù.
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
return;
}
if (m_pClientList[iClientH]->m_iAdminUserLevel == 0) {
// dwGoldCount = player gold
dwGoldCount = dwGetItemCount(iClientH, "Gold");
// if summonguildcost is greater than player gold return
if (m_iSummonGuildCost > dwGoldCount) {
return;
}
// if summonguildcost is less than player gold
else {
// reduce gold by summonguildcost
SetItemCount(iClientH, "Gold", dwGoldCount - m_iSummonGuildCost);
}
}
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;
}
pX = m_pClientList[iClientH]->m_sX;
pY = m_pClientList[iClientH]->m_sY;
//memcpy(cGuildName, m_pClientList[iClientH]->m_cGuildName, 20);
memcpy(cMapName, m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->m_cName, 11);
if (strlen(token) > 20)
memcpy(cGuildName, token, 20);
else memcpy(cGuildName, token, strlen(token));
for (i = 0; i < DEF_MAXCLIENTS; i++)
if ((m_pClientList != NULL) && (strcmp(m_pClientList->m_cGuildName, token) == 0)) {
RequestTeleportHandler(i, "2 ", cMapName, pX, pY);
}//m_pClientList->m_cCharName
wsprintf(G_cTxt,"GM Order(%s): PC(%s) Summoned to (%s)", m_pClientList[iClientH]->m_cGuildName, cGuildName, cMapName);
bSendMsgToLS(MSGID_GAMEMASTERLOG, iClientH, FALSE, G_cTxt);
ZeroMemory(cBuff, sizeof(cBuff));
cp = (char *)cBuff;
*cp = GSM_REQUEST_SUMMONGUILD;
cp++;
memcpy(cp, cGuildName, 20);
cp += 20;
memcpy(cp, cMapName, 10);
cp += 10;
wp = (WORD *)cp;
*wp = m_pClientList[iClientH]->m_sX;
cp += 2;
wp = (WORD *)cp;
*wp = m_pClientList[iClientH]->m_sY;
cp += 2;
bStockMsgToGateServer(cBuff, 25);
delete pStrTok;
}
What i am trying to do, is to make that only GuildMaster of the guild can do this command....i been changing some stuff...but no good results, any1 can help me out a bit? :unsure: