Advertisement
roamer

[C++] Anti PVP Script

Nov 5th, 2011
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. /* Modified Script of AntiPvP script for Banned Zones */
  2. /* Original Author Unknown */
  3. /* Modified By WHOS / Tekkeryole */
  4. /* Coded for Aspire HearthStone */
  5. /* Compatible with r1080+ */
  6.  
  7.  
  8. #include "StdAfx.h"
  9. #include "Setup.h"
  10.  
  11. #define MALL_ZONES 2
  12.  
  13. static uint32 MallZones[MALL_ZONES] = {394, 0};
  14.  
  15. void EventKillHandler(PlayerPointer pPlr, PlayerPointer pVictim)
  16. {
  17.     AreaTable * at = dbcArea.LookupEntry(pPlr->GetMapMgr()->GetAreaID(pPlr->GetPositionX(), pPlr->GetPositionY()));
  18.     for(uint32 i = 0; i < MALL_ZONES; i++)
  19.     {
  20.         if( at && at->ZoneId == MallZones[i] )
  21.         {
  22.             char onkick[1024];
  23.             snprintf((char*)onkick, 1024, "%s was kicked from the server for PvPing in the mall.", pPlr->GetName());
  24.             sWorld.SendWorldText(onkick);
  25.             pPlr->BroadcastMessage("You were kicked for PvPing in the mall.");
  26.             pPlr->Kick(5000);
  27.             return;
  28.         }
  29.     }
  30. }
  31. void SetupAntiPvPAtMall(ScriptMgr * mgr)
  32. {
  33.     mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &EventKillHandler);
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement