- /*
- *╔═╦═╦═╦╦╦══╦═╦╗─╔╦══╗
- *║╦╣║║║║║╠╗╗║╦╣╚╦╝║══╣
- *║╩╣║║║║║╠╩╝║╩╬╗║╔╬══║
- *╚═╩╩═╩╩═╩══╩═╝╚═╝╚══╝
- * http://emudevs.com
- */
- #include "VotePoints.h"
- class cmd_vote_points : public CommandScript
- {
- public:
- cmd_vote_points() : CommandScript("cmd_vote_points") { }
- std::vector<ChatCommand> GetCommands() const override
- {
- static std::vector<ChatCommand> pointCommandTable =
- {
- { "showpoints", rbac::RBAC_PERM_COMMAND_SHOWPOINTS, false, &HandleGetPointsCommand, "" },
- };
- static std::vector<ChatCommand> commandTable =
- {
- { "vote", rbac::RBAC_PERM_COMMAND_VOTE, true, NULL, "", pointCommandTable },
- };
- return commandTable;
- }
- static bool HandleGetPointsCommand(ChatHandler* handler, char const* args)
- {
- Player* player = handler->GetSession()->GetPlayer();
- VotePointSystem* voteSystem = sVoteSystemMgr->GetPointsByAccountId(player->GetSession()->GetAccountId());
- ChatHandler(player->GetSession()).PSendSysMessage("You have %u vote points", voteSystem->Points());
- return true;
- }
- };
- void AddSC_vote_points()
- {
- new cmd_vote_points;
- }
Votecommand.cpp