[REG] /showdmg
-
- Loyal fan
- Posts: 216
- Joined: Wed Apr 19, 2006 12:19 am
you sure the errors aren't your fault?Namesis wrote: hi, i am searching fot the /showdmg src but i cant find it and the code of Jensen is wrong it gives some errors can someone post me one good?
<img src='http://img114.imageshack.us/img114/8618 ... 2dy3lx.jpg' border='0' alt='user posted image' />
if your error looks like this its your fault
<!--QuoteBegin-"jorge_mml@hotmail.com"+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE ("jorge_mml@hotmail.com")</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->[/quote]
what i posted is exactly what was requested, the command, i didnt post anything needed to initalize vars, save to char files, actually display them etc...
<!--QuoteBegin-"jorge_mml@hotmail.com"+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE ("jorge_mml@hotmail.com")</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
Code: Select all
(1:29:21 PM) C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Game.cpp(57691) : error C2039: 'm_iShowDamage' : is not a member of 'CClient'
C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Client.h(36) : see declaration of 'CClient'
C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Game.cpp(57693) : error C2039: 'm_iShowDamage' : is not a member of 'CClient'
C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Client.h(36) : see declaration of 'CClient' C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Game.cpp(57696) : error C2039: 'm_iShowDamage' : is not a member of 'CClient'
C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Client.h(36) : see declaration of 'CClient'
what i posted is exactly what was requested, the command, i didnt post anything needed to initalize vars, save to char files, actually display them etc...
-><-
what i posted is exactly what was requested, the command, i didnt post anything needed to initalize vars, save to char files, actually display them etc... [/quote]Jensen wrote: if your error looks like this its your fault
<!--QuoteBegin-"jorge_mml@hotmail.com"+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE ("jorge_mml@hotmail.com")</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Code: Select all
(1:29:21 PM) C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Game.cpp(57691) : error C2039: 'm_iShowDamage' : is not a member of 'CClient' C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Client.h(36) : see declaration of 'CClient' C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Game.cpp(57693) : error C2039: 'm_iShowDamage' : is not a member of 'CClient' C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Client.h(36) : see declaration of 'CClient' C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Game.cpp(57696) : error C2039: 'm_iShowDamage' : is not a member of 'CClient' C:\Documents and Settings\Jorge Maldonado\Mis documentos\server\Nueva carpeta (7)\Client.h(36) : see declaration of 'CClient'
jajaj lol thats my mail
since you asked so nicely ill post a bit of it, but im going to repeat 1 more time, you will get an error like i just posted with what i put here, if you cant do something as simple as fix that error dont use these codesmolo wrote: btw... can you post /showdmg code for me?
would be nice to share with people
in ChatMsgHandler
Code: Select all
if (memcmp(cp, "/showdmglog", 11) == 0) {
AdminOrder_ShowDamageLog(iClientH);
return;
}
if (memcmp(cp, "/showdmg", 8) == 0) {
AdminOrder_ShowDamage(iClientH);
return;
}
Code: Select all
void CGame::AdminOrder_ShowDamage(int iClientH)
{
char cStatMessage[80];
if (m_pClientList[iClientH] == NULL) return;
if(m_pClientList[iClientH]->m_iShowDamage == 1)
{
m_pClientList[iClientH]->m_iShowDamage = 0;
wsprintf(cStatMessage, "Command: ShowDamage Disabled");
}else{
m_pClientList[iClientH]->m_iShowDamage = 1;
wsprintf(cStatMessage, "Command: ShowDamage Enabled");
}
ShowClientMsg(iClientH, cStatMessage);
return;
}
and the function that uses those varibles
void CGame::AdminOrder_ShowDamageLog(int iClientH)
{
char cStatMessage[80];
if (m_pClientList[iClientH] == NULL) return;
if(m_pClientList[iClientH]->m_iShowDamage == 2)
{
m_pClientList[iClientH]->m_iShowDamage = 0;
wsprintf(cStatMessage, "Command: ShowDamageLog Disabled");
}else{
m_pClientList[iClientH]->m_iShowDamage = 2;
wsprintf(cStatMessage, "Command: ShowDamageLog Enabled");
}
ShowClientMsg(iClientH, cStatMessage);
return;
}
Code: Select all
void CGame::ShowClientDmg(int iClientH,char cTargetType, int iTargetH ,int iDamage){
char cInfoString[80];
if(cTargetType == DEF_OWNERTYPE_PLAYER){
ZeroMemory(cInfoString, sizeof(cInfoString));
wsprintf(cInfoString, "Player(%s) Level(%i) Damage(%i)",m_pClientList[iTargetH]->m_cCharName,
m_pClientList[iTargetH]->m_iLevel, iDamage);
}
if(cTargetType == DEF_OWNERTYPE_NPC){
ZeroMemory(cInfoString, sizeof(cInfoString));
wsprintf(cInfoString, "Npc(%s) Damage(%i)",m_pNpcList[iTargetH]->m_cNpcName, iDamage);
}
if( m_pClientList[iClientH]->m_iShowDamage == 1)
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_IPACCOUNTINFO, NULL, NULL, NULL, cInfoString);
}else{
ShowClientMsg(iClientH, cInfoString);
}
return;
}
you could very easily inline this function, or check if its enabled in it, but i didnt feel like doing either (first because if its not being used it seems like unessecary bloat in the function, and the second for unnessecary functions calls if unused.
anything else, lemme know. theres enough information here to implement this now.
-><-