If you are making a custom room tag you always have to start with:
if(strstr(ZGetGameClient()->GetStageName(), "[ROOMTAGNAME]"))
in the Room Tag field you type the room tag name.
So you will have this:
if(strstr(ZGetGameClient()->GetStageName(), "[SAMPLE]"))
{
Function
}
// HP and AP 500/500
if(strstr(ZGetGameClient()->GetStageName(), "[500HP]"))
{
m_Property.fMaxHP.Set_CheckCrc(500);
m_fPreMaxHP = 500;
m_Property.fMaxAP.Set_CheckCrc(500);
m_fPreMaxAP = 500;
}
I Always work with strstr by my self, also i see no difference in it.Oh, so qet, you claim credits for this now, huh?
Anyway, the smarter way was to use sscanf for the [500HP].
Oh, so qet, you claim credits for this now, huh?
Anyway, the smarter way was to use sscanf for the [500HP].
Or let them type own value: ([HP=XX] [AP=XX])Code:if(strstr(ZGetGameClient()->GetStageName(), "[500HP]")) { m_Property.fMaxHP.Set_CheckCrc(500); m_fPreMaxHP = 500; m_Property.fMaxAP.Set_CheckCrc(500); m_fPreMaxAP = 500; }
int newhp = 0;
int newap = 0;
if(sscanf(ZGetGameClient()->GetStageName(), "[HP=%i] [AP=%i]", &newhp, &newap))
{
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;
}
}
Or let them type own value: ([HP=XX] [AP=XX])
Code:int newhp = 0; int newap = 0; if(sscanf(ZGetGameClient()->GetStageName(), "[HP=%i] [AP=%i]", &newhp, &newap)) { 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; } }
You can put MAX to it like 200?No good idea, because then people use it to get free exp.
if(200 > newhp > 0)
hmm, yes not working...if(200 > newhp > 0) is certainly invalid.
Actually it works 100%:ehh:if(sscanf()) is also invalid.