Problem in ek annoncer

All Helbreath Server Source Discussion here.
Post Reply
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

Hello i have questions i have HG Server 3.02 by KLKS and i try add ek annoncer (working from hg 2.24d) to that hg and i have 2 errors...

that is that ek annoncers:

Code: Select all

  ZeroMemory(cEKMsg, sizeof(cEKMsg));
                //Multiple EK Messages
                //Note - Remove section '01' and replace with alternative code for a single message
                //Alternative code: wsprintf(cEKMsg, "%s killed %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                // 01
                  switch (iDice(1,3)) 
                //You can add extra messages by creating a new case.
                //Remember to increase iDice
                {
                case 1: // To reverse the order the names appear in the message reverse the last 2 parameters
                wsprintf(cEKMsg, "%s whooped %s's ass!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 2:
                wsprintf(cEKMsg, "%s smashed %s's face into the ground!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 3:
                wsprintf(cEKMsg, "%s was sliced to pieces by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 4:
                wsprintf(cEKMsg, "%s says LAG LAG!! but gets PWNED by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 5:
                wsprintf(cEKMsg, "%s sent %s off too pie heaven!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 6:
                wsprintf(cEKMsg, "%s got beat by %s's ugly stick!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 7:
                wsprintf(cEKMsg, "%s OwneD! %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 8:
                wsprintf(cEKMsg, "%s Sended %s To Revival Zone! Too Bad;(", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 9:
                wsprintf(cEKMsg, "%s says: I CAN OWN YOU! But gets OWNED by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 10:
                wsprintf(cEKMsg, "%s KilleD %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                }
                // 01
                for (i = 1; i < DEF_MAXCLIENTS; i++) // Check all clients
                {
                if ((m_pClientList[i] != NULL))  // Check if client is avtice
                {
                SendNotifyMsg(NULL, i, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cEKMsg); // Send message to client
                // Log EK
                wsprintf(G_cTxt, "%s killed %s", cAttackerName, m_pClientList[iClientH]->m_cCharName); // Log message
                PutLogFileList(G_cTxt); // Enter into logs
                }
                }
}

Code: Select all

 - Source\Game.cpp(12315) : error C2065: 'cEKMsg' : undeclared identifier
- Source\Game.cpp(12363) : error C2065: 'PutLogFileList' : undeclared identifier
and that errors it is here:

Code: Select all

 ZeroMemory(cEKMsg, sizeof(cEKMsg));
and 2 is:

Code: Select all

 PutLogFileList(G_cTxt); // Enter into logs 
ps: some one can fix it for my?;[
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

xmukox wrote: Hello i have questions i have HG Server 3.02 by KLKS and i try add ek annoncer (working from hg 2.24d) to that hg and i have 2 errors...

that is that ek annoncers:

Code: Select all

  ZeroMemory(cEKMsg, sizeof(cEKMsg));
                //Multiple EK Messages
                //Note - Remove section '01' and replace with alternative code for a single message
                //Alternative code: wsprintf(cEKMsg, "%s killed %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                // 01
                  switch (iDice(1,3)) 
                //You can add extra messages by creating a new case.
                //Remember to increase iDice
                {
                case 1: // To reverse the order the names appear in the message reverse the last 2 parameters
                wsprintf(cEKMsg, "%s whooped %s's ass!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 2:
                wsprintf(cEKMsg, "%s smashed %s's face into the ground!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 3:
                wsprintf(cEKMsg, "%s was sliced to pieces by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 4:
                wsprintf(cEKMsg, "%s says LAG LAG!! but gets PWNED by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 5:
                wsprintf(cEKMsg, "%s sent %s off too pie heaven!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 6:
                wsprintf(cEKMsg, "%s got beat by %s's ugly stick!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 7:
                wsprintf(cEKMsg, "%s OwneD! %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 8:
                wsprintf(cEKMsg, "%s Sended %s To Revival Zone! Too Bad;(", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 9:
                wsprintf(cEKMsg, "%s says: I CAN OWN YOU! But gets OWNED by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 10:
                wsprintf(cEKMsg, "%s KilleD %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                }
                // 01
                for (i = 1; i < DEF_MAXCLIENTS; i++) // Check all clients
                {
                if ((m_pClientList[i] != NULL))  // Check if client is avtice
                {
                SendNotifyMsg(NULL, i, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cEKMsg); // Send message to client
                // Log EK
                wsprintf(G_cTxt, "%s killed %s", cAttackerName, m_pClientList[iClientH]->m_cCharName); // Log message
                PutLogFileList(G_cTxt); // Enter into logs
                }
                }
}

Code: Select all

 - Source\Game.cpp(12315) : error C2065: 'cEKMsg' : undeclared identifier
- Source\Game.cpp(12363) : error C2065: 'PutLogFileList' : undeclared identifier
and that errors it is here:

Code: Select all

 ZeroMemory(cEKMsg, sizeof(cEKMsg));
and 2 is:

Code: Select all

 PutLogFileList(G_cTxt); // Enter into logs 
ps: some one can fix it for my?;[
add cEKMsg[1000]; at the top of the function in the char part

change PutLogFileList(G_cTxt);
to
PutLogList(G_cTxt);
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

kk working thx...
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

so where about do i put the cEKMsg[1000]; becuz i keep gettin that error
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

EvilHit wrote: so where about do i put the cEKMsg[1000]; becuz i keep gettin that error
the top of the function
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

search:

Code: Select all

 void CGame::ClientKilledHandler(int iClientH, int iAttackerH, char cAttackerType, short sDamage)
and find:

Code: Select all

 char  * cp, cAttackerName[21], cData[120]
and fix with that:

Code: Select all

 char  * cp, cAttackerName[21], cData[120], cEKMsg[1000];
and add after:

Code: Select all

 // Ek Announcer
    ZeroMemory(cEKMsg, sizeof(cEKMsg));
                  switch (iDice(1,3))
                {
                case 1:
                wsprintf(cEKMsg, "%s whooped %s's ass!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 2:
                wsprintf(cEKMsg, "%s smashed %s's face into the ground!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 3:
                wsprintf(cEKMsg, "%s was sliced to pieces by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 4:
                wsprintf(cEKMsg, "%s says LAG LAG!! but gets PWNED by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 5:
                wsprintf(cEKMsg, "%s sent %s off too pie heaven!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 6:
                wsprintf(cEKMsg, "%s got beat by %s's ugly stick!", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 7:
                wsprintf(cEKMsg, "%s OwneD! %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 8:
                wsprintf(cEKMsg, "%s Sended %s To Revival Zone! Too Bad;(", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                case 9:
                wsprintf(cEKMsg, "%s says: I CAN OWN YOU! But gets OWNED by %s", m_pClientList[iClientH]->m_cCharName, cAttackerName);
                break;
                case 10:
                wsprintf(cEKMsg, "%s KilleD %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                break;
                }
                for (i = 1; i < DEF_MAXCLIENTS; i++)
                {
                if ((m_pClientList[i] != NULL))
                {
                SendNotifyMsg(NULL, i, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cEKMsg);
                wsprintf(G_cTxt, "%s killed %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
                PutLogList(G_cTxt);
                }
                }
That's all...
Treax2
Loyal fan
Posts: 281
Joined: Fri Mar 04, 2005 5:05 pm
Location: Estonia
Contact:

Post by Treax2 »



its have one mistake :D

change switch (iDice(1,3)) to switch (iDice(1,10))
Post Reply