Nussa!!! achei mto util!!principalmente p/ fazer enquetes com os players!!
mto legal msm
info
Grupo: Campones
Registrado: 20/01/07
Posts: 98
Reputação: +1

Nussa!!! achei mto util!!principalmente p/ fazer enquetes com os players!!
mto legal msm
info
Grupo: Visconde
Registrado: 10/06/06
Posts: 338
Reputação: +6
Char no Tibia: Setyte Berseker

Dá para se fazer com talkactions, se eu lembrar, faço sexta a noite.
info
Grupo: Campones
Registrado: 27/06/07
Posts: 39
Reputação: 0
Commands.cpp
abaixo de
{"/kick",&Commands::kickPlayer},add
{"/votar",&Commands::msgvote}, {"/voto",&Commands::votegm},no fim de Commands.cpp
bool Commands::msgvote(Creature* creature, const std::string &cmd, const std::string ¶m) { Player* player = dynamic_cast<Player*>(creature); if(player){ if(game->votacao == true){ if(player->jahvotou == false) { if(param == "yes") { player->jahvotou = true; game->votosyes++; std::ostringstream info; info << "Você votou 'sim'."; player->sendTextMessage(MSG_EVENT_ADVANCE, info.str().c_str()); } else if(param == "no") { player->jahvotou = true; game->votosno++; std::ostringstream info; info << "Você votou 'não'."; player->sendTextMessage(MSG_EVENT_ADVANCE, info.str().c_str()); } else { std::ostringstream info; info << "Digite '/votar yes' para votar sim e '/votar no' para votar não."; player->sendTextMessage(MSG_EVENT_ADVANCE, info.str().c_str()); } } else { std::ostringstream info; info << "Você já votou."; player->sendTextMessage(MSG_EVENT_ADVANCE, info.str().c_str()); } } else { std::ostringstream info; info << "Não há votação ocorrendo no momento."; player->sendTextMessage(MSG_EVENT_ADVANCE, info.str().c_str()); } } } bool Commands::votegm(Creature* creature, const std::string &cmd, const std::string ¶m) { std::ostringstream msg; if(game->votacao == false) { //inicia a votacao msg << "Votaçao iniciada. Tópico: " << param << ". Para votar digite /votar yes ou /votar no."; game->votacao = true; for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it) { (*it).second->sendTextMessage(MSG_EVENT_ADVANCE, msg.str().c_str()); } } else { //encerra a votacao int number = game->votosyes + game->votosno; int votyes = game->votosyes; int votno = game->votosno; msg << "Votação encerrada. " << number << " votaram. Destes, " << votyes << " votaram sim e " << votno << " votaram não."; game->votacao = false; game->votosyes = 0; game->votosno = 0; for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it) { (*it).second->sendTextMessage(MSG_EVENT_ADVANCE, msg.str().c_str()); (*it).second->jahvotou = false; } } }Commands.h
em baixo de
add
CODE
bool msgvote(Creature* creature, const std::string &cmd, const std::string ¶m);
bool votegm(Creature* creature, const std::string &cmd, const std::string ¶m);
Game.cpp
acima de
QUOTE
add
CODE
Game.h
acima de
add
Player.cpp
procure por
em baixo add
Player.h
procure por
em baixo add
Se Estiver Com Algum bug me FALE!
Obs : Codigo em 7.6 By frerety , eu transformei em 8.0!
Editado Agosto 10 por Sound Of Kill