KAKAN

For anik - IRC

Jun 3rd, 2016
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.89 KB | None | 0 0
  1. const AdminLevel = 2; //The minimum required admin level to get added to the admin list.
  2. /*
  3. Level - Rank, Sign
  4. 1 - Member, None
  5. 2 - VOP, +v
  6. 3 - HOP, +h
  7. 4 - OP, +o
  8. 5 - AOP, +a
  9. 6 - QOP, +q
  10. */
  11.  
  12. const AdminTime = 30; //Check for online admins. Value is in seconds.
  13.  
  14. Admins <- []; //This will store the admins online currently.
  15. Timer <- null;
  16.  
  17. function updateIRCAdmins()
  18. {
  19.     foreach( member in FBS_NICKS )
  20.     {
  21.         if( member.Level > AdminLevel )
  22.             Admins.push([
  23.                 member.Name,
  24.                 member.Level
  25.                 ]);
  26.     }
  27.     //You can add this to onScriptLoad to prevent command usage.
  28.     if( Timer == null ) NewTimer("updateAdmins",AdminTime,0);
  29. }
  30.  
  31. /* Optional - Usage
  32. Add this to your IRC commands list:-
  33. if( cmd == "checkforadmins" )
  34. {
  35.     updateIRCAdmins();
  36. }
  37.  
  38. else if( cmd == "getadminlist" )
  39. {
  40.     foreach( admin in Admins )
  41.         EchoMessage( "Name: " + admin[0] + ". Level: " + admin[1] )''
  42. }
  43. */
Add Comment
Please, Sign In to add comment