HiHo!
Você digita o comando /makesay player,Msg! e o player fala Msg! xD
Let's go!
Commands.cpp
procure por:
logo após adicione:{"/kick",&Commands::kickPlayer},
bool Commands::makePlayerSay(Creature* c, const std::string &cmd, const std::string ¶m){ std::string tmp = param; std::string::size_type pos; std::string message; pos = tmp.find(","); std::string name = tmp.substr(0, pos).c_str(); tmp.erase(0, pos+1); message = tmp; Creature* creature = game->getCreatureByName(name); Player* target = creature? dynamic_cast<Player*>(creature) : NULL; Player* player = dynamic_cast<Player*>©; if(target) game->creatureSay(target,SPEAK_SAY,message); else player->sendTextMessage(MSG_SMALLINFO, "The Player does not exist."); return true;}
Commands.h
procure por:
logo após adicione:bool kickPlayer(Creature* c, const std::string &cmd, const std::string ¶m);
bool makePlayerSay(Creature* c, const std::string &cmd, const std::string ¶m);
Commands.xml (data)
adicione antes de "</commands>":
<command cmd="/makesay" access="3" />
Agora dê um rebuild all (F11 no Dev-C++) e aproveite xD
Créditos: Yogha