Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // autoclaimadmin.cfg by |FOX|Yarukinasu
- // Buying Portal 2 for your love: $50
- // Playing with autogemakick.cfg script or on a modded server for your own gema needs: Priceless
- ADMIN_TIME = 10000 // default is ten seconds
- ADMIN_PASSWORD = "password"
- VOTE_WAIT_TIME = 100 // this should be higher if the ping is higher
- _autoclaimadmin = 0
- _autoclaimadminlock = 0
- autoclaimadmin = [
- if $_autoclaimadmin [
- _autoclaimadmin = 0
- echo (c 3) "autoclaimadmin has been disabled"
- ] [
- _autoclaimadmin = 1
- echo (c 0) "autoclaimadmin has been enabled"
- autoclaimadminloop
- ]
- ]
- autoclaimadminloop = [
- if $_autoclaimadmin [
- if $_autoclaimadminlock [
- if (> (- (millis) $_lastclaimed) $ADMIN_TIME) [
- claimadmin
- mastermode
- // use push and pop to avoid vote spamming
- push autoclaimadminloop
- sleep $VOTE_WAIT_TIME [
- removebans
- sleep $VOTE_WAIT_TIME [
- setadmin
- _autoclaimadminlock = 0
- pop autoclaimadminloop
- autoclaimadminloop
- ]
- ]
- ]
- ] [
- if (strcmp (at $conline 1) "CLAIMADMIN") [
- claimadmin
- // bypass checking for conline again after sleep
- loop i 20 [
- if (strcmp (at $conline) (concatword (findpn $i) ":" (c 0))) [ // h4x
- _claimedcn = $i
- ]
- ]
- sleep $VOTE_WAIT_TIME [
- giveadmin $_claimedcn
- _lastclaimed = (millis)
- _autoclaimadminlock = 1
- ]
- ]
- ]
- sleep 0 autoclaimadminloop
- ]
- ]
- claimadmin = [
- setadmin 1 $ADMIN_PASSWORD
- ]
- if (! (strstr $mapstartalways autoclaimadminloop)) [
- add2alias mapstartalways autoclaimadminloop
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement