// ---------------------------------------------------- // Master Panel, v1.2 // (C) Chaos, ZLIB license // http://www.opensource.org/licenses/zlib-license.php // ---------------------------------------------------- // Key Bind: bind "L" [ masterpanel ] // Miscellaneous Functions: _mp_listspecs = [ speclist = ""; looplist i (listclients 1) [ speclist = (concat $speclist (? (? $arg1 (isspectator $i) (! (isspectator $i))) $i)) ] result $speclist ] _mp_teamlist = [ tlist = ""; looplist i (_mp_listspecs 0) [ tlist = (concat $tlist (? (< (indexof $tlist (getclientteam $i))) (getclientteam $i))) ] result $tlist ] _mp_clientsteam = [ tcnlist = ""; looplist i (_mp_listspecs 0) [ tcnlist = (concat $tcnlist (? (=s (getclientteam $i) $arg1) $i)) ] result $tcnlist ] _mp_actions = [ looplist i (listclients 1) [ if (getalias (concatword "_mp_cn" $i)) [ do (concat $arg1 $arg2 @i) ] ] ] _mp_teamcol = [ cases $arg1 "good" [ result "^f1" ] "evil" [ result "^f3" ] [ result "^f2" ] ] _mp_privcol = [ cond (isadmin $arg1) [ result "^f6" ] (ismaster $arg1) [ result "^f0" ] [ result "^f7" ] ] _mp_cncol = [ cond (isai $arg1) [ result (concatword " ^f5[" $arg1 "]") ] (>= (listfind i (listdel (listclients 1) $arg1) [ (=s (getclientname $arg1) (getclientname $i))])) [ result (concatword " ^f5(" $arg1 ")") ] ] _mp_changeteam = [ if (= (getclientnum) $arg2) [ team $arg1 ] [ setteam $arg2 $arg1 ] ] masterpanel = [ showgui masterpanel ] // Clan Search _mp_search = "" // GUI Menu: newgui masterpanel [ guistayopen [ guialign 0 [ guitext "Master: " 0 guibutton "Claim" [ setmaster 1 ] guibar guibutton "Relinquish" [ setmaster 0 ] ] guibar guialign 0 [ guitext "Mastermode: " 0 mm = (getmastermode) guiradio "open (0)" mm 0 "mastermode 0" guibar guiradio "veto (1)" mm 1 "mastermode 1" guibar guiradio "locked (2)" mm 2 "mastermode 2" guibar guiradio "private (3)" mm 3 "mastermode 3" ] guibar guialign 0 [ guibar guilist [ if (m_teammode (getmode)) [ guialign 0 [ looplist t (_mp_teamlist) [ guibar guilist [ guialign 0 [ guibutton (concatword (_mp_teamcol @t) @t) [ looplist i (_mp_clientsteam @@t) [ (concatword "_mp_cn" $i) = (! (getalias (concatword "_mp_cn" $i))) ] ] 0 ] guibar looplist i (_mp_clientsteam $t) [ guicheckbox (concatword (_mp_privcol $i) (getclientname $i) (_mp_cncol $i)) (concatword "_mp_cn" $i) ] ] guibar ] if (> (listlen (_mp_listspecs 1))) [ guibar guilist [ guialign 0 [ guibutton "^f4spectators" [ looplist i (_mp_listspecs 1) [ (concatword "_mp_cn" $i) = (! (getalias (concatword "_mp_cn" $i))) ] ] 0 ] guibar looplist i (_mp_listspecs 1) [ guicheckbox (concatword (_mp_privcol $i) (getclientname $i) (_mp_cncol $i)) (concatword "_mp_cn" $i) ] ] guibar ] ] ] [ guialign 0 [ if (> (listlen (_mp_listspecs 0))) [ guibar guilist [ guialign 0 [ guibutton "^f2players" [ looplist i (_mp_listspecs 0) [ (concatword "_mp_cn" $i) = (! (getalias (concatword "_mp_cn" $i))) ] ] 0 ] guibar looplist i (_mp_listspecs 0) [ guicheckbox (concatword (_mp_privcol $i) (getclientname $i) (_mp_cncol $i)) (concatword "_mp_cn" $i) ] ] guibar ] if (> (listlen (_mp_listspecs 1))) [ guibar guilist [ guialign 0 [ guibutton "^f4spectators" [ looplist i (_mp_listspecs 1) [ (concatword "_mp_cn" $i) = (! (getalias (concatword "_mp_cn" $i))) ] ] 0 ] guibar looplist i (_mp_listspecs 1) [ guicheckbox (concatword (_mp_privcol $i) (getclientname $i) (_mp_cncol $i)) (concatword "_mp_cn" $i) ] ] guibar ] ] ] guibar guilist [ guilist [ guibutton "Select All" [ looplist i (listclients 1) [ (concatword "_mp_cn" $i) = 1 ] ] guibutton "Deselect All" [ looplist i (listclients 1) [ (concatword "_mp_cn" $i) = 0 ] ] guilist [ guitext "^f7Clan Search: " 0 guifield _mp_search -5 [ looplist i (listclients 1) [ (concatword "_mp_cn" $i) = (&& (!=s $_mp_search) (>= (strstr (getclientname $i) $_mp_search))) ] ] ] ] guibar guilist [ guibutton "Kick Selected" [ _mp_actions kick ] guibutton "Spectate Selected" [ _mp_actions spectator 1 ] guibutton "Unspectate Selected" [ _mp_actions spectator 0 ] ] if (m_teammode (getmode)) [ guibar guilist [ guibutton "Switch Selected to ^f1good" [ _mp_actions _mp_changeteam good ] guibutton "Switch Selected to ^f3evil" [ _mp_actions _mp_changeteam evil ] looplist i (listdel (listdel (_mp_teamlist) "good") "evil") [ guibutton (concatword "Switch Selected to^f2 " $i) [ _mp_actions _mp_changeteam @i ] ] ] ] ] ] guibar ] guinoautotab [ guibar ] ] ] "Master Panel"