Autor Wiadomość
Hill
PostWysłany: Wto 14:15, 25 Mar 2008    Temat postu: Sry

Sory ! Very Happy Prawie na Koncu Razz ... wystarczy ze na ciskniesz Ctrl + F i Wyszukasz

Kod:
void RequestResurrectPlayer(int iClientH, bool bResurrect);


i dodasz Smile w tedy tą koncowke co wyżej jest podana Razz pod tym Code Smile


P.S wszystko w Game.h Smile
Nigga
PostWysłany: Wto 14:14, 18 Mar 2008    Temat postu: [CODE] /ipban

/ipban

Kod Do Game.cpp

(Wklejamy go na samym dole pliku Game.cpp)


Kod:


void CGame::AdminOrder_BanIP(int iClientH, char *pData, DWORD dwMsgSize)
{
char seps[] = "= \t\n";
char * token, cBuff[256];
class CStrTok * pStrTok;
char * pk;
char cMsg[100], cNick[20], cIPtoBan[15];
int i;
FILE * pFile;
if (m_pClientList[iClientH] == NULL) return;
if ((dwMsgSize) <= 0) return;
if (m_pClientList[iClientH]->m_iAdminUserLevel <= 0) {
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
return;
}
if (m_pClientList[iClientH]->m_bIsAdminCommandEnabled == FALSE) 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);
pk = pStrTok->pGet();

for (i = 0; i < DEF_MAXCLIENTS; i++) {
if ((m_pClientList[i] != NULL) && (memcmp(m_pClientList[i]->m_cCharName, cNick, strlen(cNick)) == 0)) {
strcpy(cIPtoBan, m_pClientList[i]->m_cIPaddress);
//opens cfg file
pFile = fopen("..\\GameConfigs\\BannedList.cfg", "a");
//notifys to player banned
wsprintf(cMsg,"You will be banned from the server right now!");
ShowClientMsg(i, cMsg);
//notifys to game master the ban is success
wsprintf(cMsg,"%s was banned ip.",m_pClientList[iClientH]->m_cCharName);
ShowClientMsg(iClientH, cMsg);
//shows log
wsprintf(G_cTxt,"<%d> Client IP Banned: (%s)", i, cIPtoBan);
PutLogList(G_cTxt);
//modifys cfg file
fprintf(pFile, "\nbanned-ip = %s", cIPtoBan);
fclose(pFile);
//updates BannedList.cfg on the server
LocalUpdateConfigs(3);
//disconnects player, and he can't connect again.. :)
DeleteClient(i, TRUE, TRUE);
return;
}
}
delete pStrTok;
}









ame.cpp

W Funkcji ChatMsgHandler(); dodaj...(crl+f i wpisujemy /summonall potem doklejamy pod spodem ten kod)





Kod:


if (memcmp(cp, "/ipban ", 7) == 0) {
AdminOrder_BanIP(iClientH, cp, dwMsgSize - 21);
return;
}









KOD do Game.h(wklejamy go zazwyczaj na samym dole)


Kod:
void AdminOrder_BanIP(int iClientH, char *pData, DWORD dwMsgSize);

Powered by phpBB © 2001,2002 phpBB Group