Advertisement
Yarukinasu

autoclaimadmin.cfg

Jul 26th, 2011
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.74 KB | None | 0 0
  1. // autoclaimadmin.cfg by |FOX|Yarukinasu
  2. // Buying Portal 2 for your love: $50
  3. // Playing with autogemakick.cfg script or on a modded server for your own gema needs: Priceless
  4.  
  5. ADMIN_TIME     = 10000 // default is ten seconds
  6. ADMIN_PASSWORD = "password"
  7. VOTE_WAIT_TIME = 100 // this should be higher if the ping is higher
  8.  
  9. _autoclaimadmin     = 0
  10. _autoclaimadminlock = 0
  11.  
  12. autoclaimadmin = [
  13.   if $_autoclaimadmin [
  14.     _autoclaimadmin = 0
  15.     echo (c 3) "autoclaimadmin has been disabled"
  16.   ] [
  17.     _autoclaimadmin = 1
  18.     echo (c 0) "autoclaimadmin has been enabled"
  19.     autoclaimadminloop
  20.   ]
  21. ]
  22. autoclaimadminloop = [
  23.   if $_autoclaimadmin [
  24.     if $_autoclaimadminlock [
  25.       if (> (- (millis) $_lastclaimed) $ADMIN_TIME) [
  26.         claimadmin
  27.         mastermode
  28.         // use push and pop to avoid vote spamming
  29.         push autoclaimadminloop
  30.         sleep $VOTE_WAIT_TIME [
  31.           removebans
  32.           sleep $VOTE_WAIT_TIME [
  33.             setadmin
  34.             _autoclaimadminlock = 0
  35.             pop autoclaimadminloop
  36.             autoclaimadminloop
  37.           ]
  38.         ]
  39.       ]
  40.     ] [
  41.       if (strcmp (at $conline 1) "CLAIMADMIN") [
  42.         claimadmin
  43.         // bypass checking for conline again after sleep
  44.         loop i 20 [
  45.           if (strcmp (at $conline) (concatword (findpn $i) ":" (c 0))) [ // h4x
  46.             _claimedcn = $i
  47.           ]
  48.         ]
  49.         sleep $VOTE_WAIT_TIME [
  50.           giveadmin $_claimedcn
  51.           _lastclaimed = (millis)
  52.           _autoclaimadminlock = 1
  53.         ]
  54.       ]
  55.     ]
  56.     sleep 0 autoclaimadminloop
  57.   ]
  58. ]
  59. claimadmin = [
  60.   setadmin 1 $ADMIN_PASSWORD
  61. ]
  62.  
  63. if (! (strstr $mapstartalways autoclaimadminloop)) [
  64.   add2alias mapstartalways autoclaimadminloop
  65. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement