How To make a command that changes an aponennt hp and ap.

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Account Upgraded | Title Enabled! Rejain is offline
    MemberRank
    Jul 2012 Join Date
    201Posts

    big grin How To make a command that changes an aponennt hp and ap.

    Hi, im using a1tl4's room tag and i want to convert it into a command, i dont know how to do it, like how to change hp and ap, to add 2 paramters to the command for example :
    /sethpap Rejain 120 100

    you guys got it ?
    Thanks for the helpers hahaha


  2. #2
    Account Upgraded | Title Enabled! ofiritsmeeee is offline
    MemberRank
    Sep 2011 Join Date
    274Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by Rejain View Post
    Hi, im using a1tl4's room tag and i want to convert it into a command, i dont know how to do it, like how to change hp and ap, to add 2 paramters to the command for example :
    /sethpap Rejain 120 100

    you guys got it ?
    Thanks for the helpers hahaha
    I already done /maxhp <playername> which heals your char to your max HP and ap..
    Just Use :
    Code:
    ZGetGame()->m_pMyCharacter->SetHP(ZGetGame()->m_pMyCharacter->GetMaxHP());
    ZGetGame()->m_pMyCharacter->SetAP(ZGetGame()->m_pMyCharacter->GetMaxAP());

  3. #3
    Account Upgraded | Title Enabled! Rejain is offline
    MemberRank
    Jul 2012 Join Date
    201Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by ofiritsmeeee View Post
    I already done /maxhp <playername> which heal your char to your max HP and ap..
    Cool, but the point here is that you enter your custom amount of hp
    not maxhp
    btw its not that hard ....

  4. #4
    Fuck Army. sahar042 is offline
    MemberRank
    Jul 2009 Join Date
    833Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by Rejain View Post
    Cool, but the point here is that you enter your custom amount of hp
    not maxhp
    btw its not that hard ....
    Use paramater to do it.

  5. #5
    Account Upgraded | Title Enabled! Rejain is offline
    MemberRank
    Jul 2012 Join Date
    201Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by sahar042 View Post
    Use paramater to do it.
    Thats what i want to know how to do, im not sure how to do it ? whould i add a variable in ZCharacter.h and use seomthing like the Godmode command ?

  6. #6
    Account Upgraded | Title Enabled! ofiritsmeeee is offline
    MemberRank
    Sep 2011 Join Date
    274Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by Rejain View Post
    Thats what i want to know how to do, im not sure how to do it ? whould i add a variable in ZCharacter.h and use seomthing like the Godmode command ?
    int numhp;
    int numap;
    would help.

    Quote Originally Posted by sahar042 View Post
    Use paramater to do it.
    BTW sahar , could you give me the HEX color was on game-servGunz for VIP's?

  7. #7
    Account Upgraded | Title Enabled! Rejain is offline
    MemberRank
    Jul 2012 Join Date
    201Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by ofiritsmeeee View Post
    int numhp;
    int numap;
    would help.



    BTW sahar , could you give me the HEX color was on game-servGunz for VIP's?
    To make this easier ill just post my code and then help me.
    Code:
    void ZCharacter::SetHPAp()
    {
    	int newhp = 0;
    	int newap = 0;
    	if(ZGetConfiguration()->GetEtc()->bsethpap)
    	{
    		if(newhp > 0)
    		{
    			m_Property.fMaxHP.Set_CheckCrc(newhp);
    			m_fPreMaxHP = newhp;
    		}
    		if(newap > 0)
    		{
    			m_Property.fMaxAP.Set_CheckCrc(newap);
    			m_fPreMaxAP = newap;
    		}
    		else
    		{
    			m_Property.fMaxHP.Set_CheckCrc(pCharInfo->nHP + fAddedHP);
    			m_fPreMaxHP = pCharInfo->nHP + fAddedHP;
    			m_Property.fMaxAP.Set_CheckCrc(pCharInfo->nAP + fAddedAP);
    			m_fPreMaxAP = pCharInfo->nAP + fAddedAP;
    		}
    	}
    }
    now im not sure what to add in ZChat_Cmds.cpp
    any help ?

  8. #8
    Account Upgraded | Title Enabled! ofiritsmeeee is offline
    MemberRank
    Sep 2011 Join Date
    274Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by Rejain View Post
    To make this easier ill just post my code and then help me.
    Code:
    void ZCharacter::SetHPAp()
    {
    	int newhp = 0;
    	int newap = 0;
    	if(ZGetConfiguration()->GetEtc()->bsethpap)
    	{
    		if(newhp > 0)
    		{
    			m_Property.fMaxHP.Set_CheckCrc(newhp);
    			m_fPreMaxHP = newhp;
    		}
    		if(newap > 0)
    		{
    			m_Property.fMaxAP.Set_CheckCrc(newap);
    			m_fPreMaxAP = newap;
    		}
    		else
    		{
    			m_Property.fMaxHP.Set_CheckCrc(pCharInfo->nHP + fAddedHP);
    			m_fPreMaxHP = pCharInfo->nHP + fAddedHP;
    			m_Property.fMaxAP.Set_CheckCrc(pCharInfo->nAP + fAddedAP);
    			m_fPreMaxAP = pCharInfo->nAP + fAddedAP;
    		}
    	}
    }
    now im not sure what to add in ZChat_Cmds.cpp
    any help ?
    -_-'
    you're doing it wrong , why are you using ENABLE\DISABLE COMMAND?

  9. #9
    Account Upgraded | Title Enabled! Rejain is offline
    MemberRank
    Jul 2012 Join Date
    201Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by ofiritsmeeee View Post
    -_-'
    you're doing it wrong , why are you using ENABLE\DISABLE COMMAND?
    I can change it, btw i dont really know how to make other commands LOL
    THATS WHY I OPENED THE THREAD TO KNOW HOW TO MAKE A DIFFRENT KIND OF COMMAND

  10. #10
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    Re: How To make a command that changes an aponennt hp and ap.

    I got it, you need to do a new packet with the targetname. I may tmw share you it.
    The code you posted is very very wrong. All you need is to use sethp(int)

  11. #11
    Account Upgraded | Title Enabled! ofiritsmeeee is offline
    MemberRank
    Sep 2011 Join Date
    274Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by Rejain View Post
    I can change it, btw i dont really know how to make other commands LOL
    THATS WHY I OPENED THE THREAD TO KNOW HOW TO MAKE A DIFFRENT KIND OF COMMAND
    You need to make the command like that:
    Code:
    char* szTargetName = argv[1];
    Your code is very wrong because the command is ENABLE\DISABLE.

  12. #12
    Account Upgraded | Title Enabled! Rejain is offline
    MemberRank
    Jul 2012 Join Date
    201Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by qet123 View Post
    I got it, you need to do a new packet with the targetname. I may tmw share you it.
    The code you posted is very very wrong. All you need is to use sethp(int)
    What do you mean can you be more specific ? or maybe make a tut like you did for disable/enable only with more packets and shit ..
    by the way you mean this function ?
    Code:
    ZGetGame()->m_pMyCharacter->SetHP(0);
    If you do, what do i put in the () ?? if i want it to make it change by whatever the player wants
    Code:
    ZGetGame()->m_pMyCharacter->SetHP("%d" || "%s" || "%i");
    what to use im not sure ..
    Thanks anyway.

    Quote Originally Posted by ofiritsmeeee
    Your code is very wrong because the command is ENABLE\DISABLE.
    ik that, thanks for helping, but what i also need is the set hp parameter and set ap parameter, which im not sure how to make, thanks anyway

    OFF TOPIC :
    im using iGunz website, and it dosent work in chrome any fix ?

    EDIT : i have been working on it, and i am trying to build this code in ZChat_Cmds.cpp
    Code:
    void sethp(const char* line, const int argc, char **const argv)
    {
        if (argc < 4)
        {
           ZChatOutput("^2Please enter a player name and a value of hp and ap !", ZChat::CMT_SYSTEM);
    		return;
        }
    	float newhp = 0;
    	float newap = 0;
    	char* szhpnum = argv[1];
    	char* szapnum = argv[2];
    	char* szTargetName = argv[3];
    	newhp = szhpnum;
    	newhp = szapnum;
    	ZGetGame()->m_pMyCharacter->SetHP(newhp);
    	ZGetGame()->m_pMyCharacter->SetAP(newap);
    	ZChatOutput("^2HP and AP succsessfully changed !", ZChat::CMT_SYSTEM);
    }
    Now, i know that its immpossible to convert a flaot to a character, but i dont know what to do any ideas ?
    Last edited by Rejain; 10-01-13 at 08:02 PM.

  13. #13
    Account Upgraded | Title Enabled! ofiritsmeeee is offline
    MemberRank
    Sep 2011 Join Date
    274Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by Rejain View Post
    What do you mean can you be more specific ? or maybe make a tut like you did for disable/enable only with more packets and shit ..
    by the way you mean this function ?
    Code:
    ZGetGame()->m_pMyCharacter->SetHP(0);
    If you do, what do i put in the () ?? if i want it to make it change by whatever the player wants
    Code:
    ZGetGame()->m_pMyCharacter->SetHP("%d" || "%s" || "%i");
    what to use im not sure ..
    Thanks anyway.


    ik that, thanks for helping, but what i also need is the set hp parameter and set ap parameter, which im not sure how to make, thanks anyway

    OFF TOPIC :
    im using iGunz website, and it dosent work in chrome any fix ?

    EDIT : i have been working on it, and i am trying to build this code in ZChat_Cmds.cpp
    Code:
    void sethp(const char* line, const int argc, char **const argv)
    {
        if (argc < 4)
        {
           ZChatOutput("^2Please enter a player name and a value of hp and ap !", ZChat::CMT_SYSTEM);
    		return;
        }
    	float newhp = 0;
    	float newap = 0;
    	char* szhpnum = argv[1];
    	char* szapnum = argv[2];
    	char* szTargetName = argv[3];
    	newhp = szhpnum;
    	newhp = szapnum;
    	ZGetGame()->m_pMyCharacter->SetHP(newhp);
    	ZGetGame()->m_pMyCharacter->SetAP(newap);
    	ZChatOutput("^2HP and AP succsessfully changed !", ZChat::CMT_SYSTEM);
    }
    Now, i know that its immpossible to convert a flaot to a character, but i dont know what to do any ideas ?
    You're still doing it wrong..
    You need a packet for that , not all the function is in the ZchatCMDS.CPP.

  14. #14
    Account Upgraded | Title Enabled! Rejain is offline
    MemberRank
    Jul 2012 Join Date
    201Posts

    Re: How To make a command that changes an aponennt hp and ap.

    Quote Originally Posted by ofiritsmeeee View Post
    You're still doing it wrong..
    You need a packet for that , not all the function is in the ZchatCMDS.CPP.
    OMG.. i made this thread so people will HELP ME not tell me if im doing it wrong or right ..

  15. #15
    Fuck Army. sahar042 is offline
    MemberRank
    Jul 2009 Join Date
    833Posts

    Re: How To make a command that changes an aponennt hp and ap.

    We are helping to you, No one going to do it for you.
    We told you to do parameter, More hint - You can copy whisper parameters and edit it.



Page 1 of 2 12 LastLast

Advertisement