Advertisement
julienanid

[Trinity] Protect your GM island from hackers

Sep 30th, 2013
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.61 KB | None | 0 0
  1. /*
  2. <--------------------------------------------------------------------------->
  3. - Developer(s): JessiqueBA
  4. - Complete: %100
  5. - ScriptName: 'vipmall_security'
  6. - Comment: Untested.
  7. - Shared for:Emudevs by Synth
  8. <--------------------------------------------------------------------------->
  9. */
  10.  
  11. enum ForbiddenAreas
  12. {
  13.     AREA_VIP_MALL            = 3817,  // Testing Zone
  14.     AREA_VIP_ISLAND          = 2317,  // South Seas (Tanaris)
  15.     AREA_GM_ISLAND           = 876    // GM Island
  16. };
  17.      
  18. class vipmall_security : public PlayerScript
  19. {
  20. public:
  21.     vipmall_security() : PlayerScript("vipmall_security") {}
  22.      
  23.     void OnUpdateZone(Player* player, uint32 newZone, uint32 newArea)
  24.     {
  25.         switch (newArea)
  26.         {
  27.             case AREA_VIP_MALL:
  28.             case AREA_VIP_ISLAND:
  29.                 // if player is vip and reach the vipmall..
  30.                 if (player->GetSession()->GetSecurity() >= 1) // Or RBAC 'HasPermission(rbac::PERMISSION_NAME);'
  31.                     return;
  32.                 player->TeleportTo(1, 6566.661133f, -4047.084473f, 658.646118f, 2.083416f); // Teleport to dueling zone
  33.                 break;
  34.             case AREA_GM_ISLAND:
  35.                 // Allow acces to GM island only for staff members
  36.                 if (player->GetSession()->GetSecurity() >= 2) // Or RBAC 'HasPermission(rbac::PERMISSION_NAME);'
  37.                     return;
  38.                 player->TeleportTo(1, 6566.661133f, -4047.084473f, 658.646118f, 2.083416f); // Teleport to dueling zone
  39.                 break;
  40.         }
  41.     }
  42. };
  43.      
  44. void AddSC_vipmall_security()
  45. {
  46.     new vipmall_security();
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement