[SELECT ALL] Code:
exec config/admin_passwords_list.cfg
alias adminpasswordposition -1
alias claimadmin [
if ( && (= $connected 1) (= (currole) 0) ) [
if (> (listlen $adminpasswordslist) 0)[
alias adminpasswordposition [ findlist $adminpasswordslist (curserver 1) ]
if (!= (adminpasswordposition) -1)[
setadmin 1 ( at $adminpasswordslist (+ (adminpasswordposition) 1) )
][
alias adminpasswordposition [ findlist $adminpasswordslist (concatword (curserver 1) : (curserver 3)) ]
if (!= (adminpasswordposition) -1)[
setadmin 1 ( at $adminpasswordslist (+ (adminpasswordposition) 1) )
][
alias gn_curservername (curserver 2)
alias adminpasswordposition [ findlist $adminpasswordslist $gn_curservername ]
if (!= (adminpasswordposition) -1)[
setadmin 1 ( at $adminpasswordslist (+ (adminpasswordposition) 1) )
][
alias adminpasswordposition [ findlist $adminpasswordslist (concatword $gn_curservername : (curserver 3)) ]
if (!= (adminpasswordposition) -1)[
setadmin 1 ( at $adminpasswordslist (+ (adminpasswordposition) 1) )
][
echo "Cannot find an admin password for this server in your configuration"
]
]
]
]
][
echo "Admin passwords list is empty"
]
][
setadmin 0
]
]
// By grenadier
- Copy and paste the above code into your autoexec.cfg
- Make a new text file named admin_passwords_list.cfg
- Fill the file with server IP's and/or ports with the corresponding admin passwords for that server. (See example below.)
[SELECT ALL] Code:
alias adminpasswordslist [
SERVER1IPHERE PASSWORDHERE // works for all servers running on that IP - assuming you have the same password for all of them
SERVER2IP2HERE:PORTHERE PASSWORDHERE // works for the specific server running on the port that you specify
SERVER3IPHERE PASSWORDHERE
SERVER4IPHERE:PORTHERE PASSWORDHERE ]
Important: Each server IP and password should be on it's own line within admin_passwords_list.cfg - On windows there MUST be a space after every password, otherwise the script will not work correctly.
From now on, /claimadmin will take admin status on any servers listed in admin_passwords_list.cfg - for ease of use, I recommend binding it to a key like so:
[SELECT ALL] Code:
bind "KEY" [claimadmin]
Tip: Pressing your claimadmin keybind a second time, or typing /claimadmin a second time, will drop admin status.