Advertisement
Emulation

Untitled

Sep 25th, 2013
787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include "Player.h"
  2. #include "ScriptPCH.h"  
  3. class afk_protection : public PlayerScript
  4. {
  5. public:
  6.     afk_protection() : PlayerScript("afk_protection") { }
  7.    
  8.     bool isAFK(Player* player)
  9.     {
  10.         if(player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK) == true)
  11.             {
  12.                 player->AddAura(58729);
  13.                 return true;
  14.             }
  15.             else
  16.                 if(player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK) == false)
  17.                     {
  18.                         player->RemoveAura(58729);
  19.                         return false;
  20.                     }
  21.                 }
  22.             };
  23.            
  24.            
  25. void AddSC_afk_protection()
  26. {
  27.     new afk_protection();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement