EOSERV Forum > EO Server Building > need help making it when i use my admin command
Page: << 1 >>
need help making it when i use my admin command
Author Message
Post #204237 need help making it when i use my admin command

when i use my admin command for like 606 #update str 606 it gives me the 606 but my str stays the same could anyone help me out with some info plz thnx.

6 years, 25 weeks ago
Post #204238 Re: need help making it when i use my admin command

You need to calculate stats again after the command, check this out


else if (command.length() >= 6 && command.compare(0,6,"update") == 0 && arguments.size() >= 2)

                {

                    character->CalculateStats();

                    short *stat = 0;

                    int amount = util::to_int(arguments[1]);


                    if (amount < 0 || amount > character->statpoints) return;


                    if (arguments[0] == "str") stat = &character->str;

                    if (arguments[0] == "int") stat = &character->intl;

                    if (arguments[0] == "wis") stat = &character->wis;

                    if (arguments[0] == "agi") stat = &character->agi;

                    if (arguments[0] == "con") stat = &character->con;

                    if (arguments[0] == "cha") stat = &character->cha;


                    if (stat == 0) return;


                    (*stat) += amount;

                    character->statpoints -= amount;



                    character->CalculateStats();


                    PacketBuilder builder(PACKET_RECOVER, PACKET_LIST, 32);

                    builder.SetID(PACKET_STATSKILL, PACKET_PLAYER);

                    builder.AddShort(character->statpoints);


                    builder.AddShort(character->display_str);

                    builder.AddShort(character->display_intl);

                    builder.AddShort(character->display_wis);

                    builder.AddShort(character->display_agi);

                    builder.AddShort(character->display_con);

                    builder.AddShort(character->display_cha);

                    builder.AddShort(character->maxhp);

                    builder.AddShort(character->maxtp);

                    builder.AddShort(character->maxsp);

                    builder.AddShort(character->maxweight);

                    builder.AddShort(character->mindam);

                    builder.AddShort(character->maxdam);

                    builder.AddShort(character->accuracy);

                    builder.AddShort(character->evade);

                    builder.AddShort(character->armor);

                    character->Send(builder);




                }

6 years, 25 weeks ago
Post #204240 Re: need help making it when i use my admin command

so where do i put that file?

6 years, 25 weeks ago
Post #204242 Re: need help making it when i use my admin command

Put it in your new command. You said that you have your admin command, what i wrote is an example from Talk.cpp where i keep my player commands

6 years, 25 weeks ago
Page: << 1 >>

EOSERV Forum > EO Server Building > need help making it when i use my admin command