eae galera eu venho traze um comando que eu acho que pode ajudar mtu gm por ai
server usado foi avesta revisão 3086
ai vai o code
adicione em commands.cpp depois de
{"/raid",&Commands::forceRaid},
adicione
{"/skull",&Commands::changeSkull},
no final do arquivo adicione
bool Commands::changeSkull(Creature* creature, const std::string& cmd, const std::string& param) { std::stringstream msg, param_stream(param); std::string name, skullType, skull; if(!getline(param_stream, name, ',')) { if(creature && creature->getPlayer()) creature->getPlayer()->sendCancel("No player specified."); return false; } Player* player = game->getPlayerByName(name); if(!player) { if(creature && creature->getPlayer()) creature->getPlayer()->sendCancel("Player is not online."); return false; } param_stream >> skullType; if(skullType == "white"){ Tile* tile = player->getTile(); if(!tile->hasFlag(TILESTATE_PROTECTIONZONE)){ player->pzLocked = true; player->addInFightTicks(); player->setSkull(SKULL_WHITE); player->sendTextMessage(MSG_INFO_DESCR, "You have a white skull now."); } else{ creature->getPlayer()->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "This player is on a pz tile."); return false; } } else if(skullType == "red"){ player->redSkullTicks = 3 * 60 * 60 * 1000; player->setSkull(SKULL_RED); player->sendTextMessage(MSG_INFO_DESCR, "You have a red skull now."); } else if(skullType == "noskull"){ player->redSkullTicks = 0; player->setSkull(SKULL_NONE); player->sendTextMessage(MSG_INFO_DESCR, "Your skull has been removed."); } else{ creature->getPlayer()->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "This isn\'t a valid skull type."); return false; } g_game.updateCreatureSkull(player); return true; }
e agora pra finalizar em commands.h abaixo de
bool forceRaid(Creature* creature, const std::string& cmd, const std::string& param);
adicione
bool changeSkull(Creature* creature, const std::string &cmd, const std::string ¶m);
a e nao se esqueçam de por em commands.xml
<command cmd="/skull" access="3"/> -- Change player skull example : "/skull Fusion, white"
caso encontrem bugs por favor postem para eu poder corrigo-lo
flw