1. /*
  2. *╔═╦═╦═╦╦╦══╦═╦╗─╔╦══╗
  3. *║╦╣║║║║║╠╗╗║╦╣╚╦╝║══╣
  4. *║╩╣║║║║║╠╩╝║╩╬╗║╔╬══║
  5. *╚═╩╩═╩╩═╩══╩═╝╚═╝╚══╝
  6. * http://emudevs.com
  7. */
  8. #include "VotePoints.h"
  9. class cmd_vote_points : public CommandScript
  10. {
  11. public:
  12. cmd_vote_points() : CommandScript("cmd_vote_points") { }
  13. ChatCommand* GetCommands() const
  14. {
  15. static ChatCommand pointCommandTable[] =
  16. {
  17. { "getpoints", SEC_PLAYER, false, &HandleGetPointsCommand, "", NULL },
  18. { NULL, 0, false, NULL, "", NULL }
  19. };
  20. static ChatCommand commandTable[] =
  21. {
  22. { "vote", SEC_PLAYER, true, NULL, "", pointCommandTable },
  23. { NULL, 0, false, NULL, "", NULL }
  24. };
  25. return commandTable;
  26. }
  27. static bool HandleGetPointsCommand(ChatHandler* handler, char const* args)
  28. {
  29. Player* player = handler->GetSession()->GetPlayer();
  30. VotePointSystem* voteSystem = sVoteSystemMgr->GetPointsByAccountId(player->GetSession()->GetAccountId());
  31. ChatHandler(player->GetSession()).PSendSysMessage("You have %u vote points", voteSystem->Points());
  32. return true;
  33. }
  34. };
  35. void AddSC_vote_points()
  36. {
  37. new cmd_vote_points;
  38. }

Command VotePoints Source File!