- Joined
- Apr 12, 2009
- Messages
- 1,260
- Reaction score
- 239
For those who are willing to make custom command for players, enabled / disabled command one like /hpapbar etc. Here is example: (The command can be enabled in lobby/stage/game(every place)
ZChat_Cmds.cpp:
ZConfiguration.h:
ZCombatInterface.cpp:
[/CODE]
Adding it to config.xml (mocrogamers idea):
Now this is a simple tut how to make custom commands, it will enable hpap bar everytime you type /firstcommand, for more info about commands and understanding them enter here: http://forum.ragezone.com/f497/adding-custom-command-packets-816740/
Like if i helped you.
ZChat_Cmds.cpp:
Code:
[B]Line 25:[/B]
void firstcommand(const char* line, const int argc, char **const argv);
[B]Line 161:[/B]
_CC_AC("firstcommand", &firstcommand, CCF_ALL, ARGVNoMin, 1, true, "/firstcommand", "");
[B]Above:[/B]
void ChatCmd_Help(const char* line, const int argc, char **const argv)
[B]Paste this:[/B]
#include "ZOptionInterface.h"
void firstcommand(const char* line, const int argc, char **const argv)
{
ZGetConfiguration()->GetEtc()->bfirstcommand = ((ZGetConfiguration()->GetEtc()->bfirstcommand == false) ? true : false);
if(ZGetConfiguration()->GetEtc()->bfirstcommand)
ZChatOutput("^2 First Command Enabled");
else
ZChatOutput("^2 First Command Disabled");
ZGetOptionInterface()->SaveInterfaceOption();
}
Code:
[B]Line 130:[/B]
bool bfirstcommand;
[B]Line 448:[/B]
#define Z_ETC_FIRSTCOMMAND (ZGetConfiguration()->GetEtc()->bfirstcommand)
Code:
[B]
[B]Under:[/B]
ZGetScreenEffectManager()->DrawMyHPPanal(pDC);
[B]Change:[/B]
#ifdef _DEBUG to #ifdef _PUBLISH
[B]Under:[/B]
char szMsg[128] = { 0, };
[B]Paste:[/B]
[B][COLOR="#B22222"]if(ZGetConfiguration()->GetEtc()->bfirstcommand)[/COLOR][/B]
{
sprintf(szMsg, "HP : %f / %f", pCharacter->GetHP(), pCharacter->GetMaxHP());
pDC->Text(nX, nY, szMsg);
sprintf(szMsg, "AP : %f / %f", pCharacter->GetAP(), pCharacter->GetMaxAP());
pDC->Text(nX, nY + 30, szMsg);
}
[/B]
*Sometimes you may get errors of "ZGetConfiguration", just include[CODE] #include "ZConfiguration.h"
Adding it to config.xml (mocrogamers idea):
ZConfiguration.cpp
ZConfiguration.cpp
Code:
[B]Under:[/B]
childElement.GetChildContents(&m_Etc.nFrameLimit_perSecond, ZTOK_ETC_FRAMELIMIT_PERSECOND);
[B]Paste:[/B]
childElement.GetChildContents(&m_Etc.bfirstcommand, ZTOK_ETC_FIRSTCOMMAND);
[B]Under:[/B]
// FrameLimit
parentElement.AppendText("ntt");
aElement = parentElement.CreateChildElement(ZTOK_ETC_FRAMELIMIT_PERSECOND);
sprintf(temp, "%i", m_Etc.nFrameLimit_perSecond);
aElement.SetContents(temp);
[B]Paste:[/B]
// Firstcommand
parentElement.AppendText("ntt");
aElement = parentElement.CreateChildElement(ZTOK_ETC_FIRSTCOMMAND);
sprintf(temp, "%s", m_Etc.bfirstcommand?"TRUE":"FALSE");
aElement.SetContents(temp);
Code:
[B]Under:[/B]
#define ZTOK_ETC_FRAMELIMIT_PERSECOND "FRAMELIMIT"
[B]Paste:[/B]
#define ZTOK_ETC_FIRSTCOMMAND "FIRSTCOMMAND"
Like if i helped you.
Last edited: