EOSERV Forum > EOSERV > Player Command Handler Release [Revision 300+]
Topic is locked.
Page: << 1 >>
Player Command Handler Release [Revision 300+]
Author Message
Post #163684 Player Command Handler Release [Revision 300+]

Hierarchy :

   Src->playercommands

   Src->playercommands->playercommands.cpp

   Src->playercommands->playercommands.hpp


Download this files and put them into a similar hierarchy like the commands folder (like the above)

playercommands.cpp

playercommands.hpp

(Note: I do not take credit for these handlers as all I did was change the names of the functions)


Now after these are added into your source you should have something like this


Don't worry about the char_mod. That's just an example file for the player commands.


Now, go into world.cpp and add this function.

Also, add void World::PlayerCommand(std::string command, const std::vector<std::string>& arguments, Command_Source* from); into the world.hpp


Now, go into talk.cpp and find this line : 

#include "../commands/commands.hpp"

and add this line under it. : 

#include "../playercommands/commands.hpp"


Now find this block of code :

if (character->admin && message[0] == '$')

{

std::string command;

std::vector<std::string> arguments = util::explode(' ', message);

command = arguments.front().substr(1);

arguments.erase(arguments.begin());


character->world->Command(command, arguments, character);

}

and add this under it. This will go above the else statement!

else

{

character->map->Msg(character, message, false);

}


char_mod.cpp for those who want it. It works just like the regular admin commands.

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
11 years, 35 weeks ago
Post #163687 Re: Player Command Handler Release [Revision 300+]

Nice, I've been meaning to get around to making something like this, I just ended up doing other stuff cause I have the attention span of a child. Anyways, +1 and all that xP I'll definitely make use of this.

11 years, 35 weeks ago
Post #163693 Re: Player Command Handler Release [Revision 300+]

Haha, there really wasnt much to make. You just had to rename all of the functions of the command handler file and then use a different char to call that handler.

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
11 years, 35 weeks ago
Post #163695 Re: Player Command Handler Release [Revision 300+]

Yea, I never get around to doing the easy stuff. xP I feel compelled to try out the stuff I don't know how to do for some reason. o.o Then I end up with a big to-do list.

11 years, 35 weeks ago
Post #163699 Re: Player Command Handler Release [Revision 300+]

Haha, yeah but thats good :D the more you explore the faster you learn and the better you get. 

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
11 years, 35 weeks ago
Post #163933 Re: Player Command Handler Release [Revision 300+]

+1, I've been waiting for this.

11 years, 35 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > Player Command Handler Release [Revision 300+]