Files
assaultcube-/config/admin.cfg
T
Lucas GAUTHERON fed2e7c200 admin.cfg commands : alias to const, doc updates
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6745 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-01-01 16:45:46 +00:00

115 lines
7.1 KiB
INI

ingall = 0
const kick [ callvote 0 $arg1 $arg2 ]
const ban [ callvote 1 $arg1 $arg2 ]
const removebans [ callvote 2 $arg1 ]
const mastermode [ callvote 3 $arg1 ]
const autoteam [ callvote 4 $arg1 ]
const forceteam [ callvote 5 $arg1 ]
const forceme [ forceteam (findcn $curname) ]
const ignoreall [ if $connected [ ingall = 1; loop ia 21 [ ignore $ia ]; echo (c 1)NOTE: (c 5)All clients currently on the server were ignored. ] ]
const unignoreall [ if $connected [ ingall = 0; clearignored ]; echo (c 1)NOTE: (c 5)All clients currently on the server were unignored. ]
const giveadmin [ callvote 6 $arg1 ]
const map [ callvote 7 $arg1 $arg2 ]
const recorddemo [ callvote 8 1 ]
const stopdemo [ callvote 9 ]
const cleardemo [ callvote 10 $arg1 ]
const cleardemos [ callvote 10 0 ]
const serverdesc [ callvote 11 $arg1 ]
const shuffleteams [ callvote 12 ]
const demo [
_demofile = $arg1
if $connected [
addOnLoadOnce [ mode -1; map $_demofile ]
disconnect
] [
mode -1; map $_demofile
]
]
// Kick/Ban/Reason menu script begins below.
tmpKBR = ""; tmpVic = ""; if (! (checkalias tmpKBP)) [ tmpKBP = "" ]; if (! (checkalias tmpKBMM)) [ tmpKBMM = 0 ]
selKBItem = [ tmpVic = (getalias arg1); tmpKBR = ""; showmenu reason ]
genKBItem = [
if (> $numargs 0) [
tmpArg1 = $arg1; tmpKArg = (concat selKBItem $tmpArg1)
if (curmodeattr team) [
menuitem (concatword (findpn $arg1) (c 2) " (" $arg1 ")" (c 5) " - " (c 4) (at (concat (concatword (c 3) CLA (c 4)) (concatword (c 1) RVSF (c 4))) (at (pstat_score $arg1) 4)) (c 5)) (addpunct $tmpKArg 2)
] [
menuitem (concatword (findpn $arg1) (c 2) " (" $arg1 ")" (c 5)) (addpunct $tmpKArg 2)
]
]
]
genKBMenu = [ loop gbl (curplayers) [ if (&& (! (strcmp (findpn $gbl) "")) (!= (findcn $curname) $gbl)) [ genKBItem $gbl ] ] ]
refreshKBM = [ if (!= $arg1 0) [ closemenu reason; sleep 0 [ showmenu reason ] ] [ closemenu kick/ban; sleep 0 [ showmenu kick/ban ] ] ]
hasValidClients = [
hvcOutput = 0
loop hvl (curplayers) [ if (&& (! (strcmp (findpn $hvl) "")) (!= $hvl (findcn $curname))) [ hvcOutput = 1; break ] ]
result $hvcOutput
]
kickBanMenu = [
newmenu kick/ban
menuinit [ delmenu kick/ban; kickBanMenu ]
menuitem "Refresh list" [ refreshKBM ]
menuitem "Remove all bans" [ removebans; refreshKBM ]
menuitemtextinput "Admin password: " "" [ tmpKBP = $arg1 ] 0 256
menuitem "Toggle admin status" [ if $connected [ if (currole) [ setadmin; echo you dropped admin status ] [ if (&& (strlen $tmpKBP) (! (strcmp $tmpKBP ""))) [ setadmin 1 $tmpKBP ] ]; refreshKBM ] ]
menuitem "Toggle autoteam" [ if $connected [ if (curautoteam) [ autoteam 0 ] [ autoteam 1 ]; refreshKBM ] ]
menuitemtextinput "Mastermode: " (getalias tmpKBMM) [ if (< $arg1 3) [ tmpKBMM = $arg1 ] [ echo (c 3)Error: (c 5)Valid range for mastermode is 0-2.; tmpKBMM = 0 ] ] 0 1
menuitem "Change mastermode" [ if (&& (< $tmpKBMM 3) (!= (curmastermode) $tmpKBMM)) [ if $connected [ mastermode $tmpKBMM ] ]; refreshKBM ]
menuitem "" -1
menuitem "OK" [ closemenu kick/ban ]
menuitem "" -1
if (hasValidClients) [ menuitem "Choose a client: " -1 ] [ menuitem "No valid clients available." -1 ]
menuitem "" -1
genKBMenu
]
kickBanMenu
newmenu reason
menuitemvar [ if (currole) [ concat (c 1)Note: (c 5)You currently have admin status. Your vote will be forced. ] ]
menuitemvar [ if (! (strcmp (findpn $tmpVic) "")) [ if (curmodeattr team) [ concat (c 9) Target client: " " (concatword (c 5) (findpn $tmpVic) " - cn: " (c 2) $tmpVic (c 5) " - team: " (at (concat (concatword (c 3) CLA) (concatword (c 1) RVSF)) (at (pstat_score $tmpVic) 4)) (c 5) " - tks: " (c 2) (at (pstat_score $tmpVic) 5)) ] [ concat (c 9) Target client: " " (concatword (c 5) (findpn $tmpVic) " - cn: " (c 2) $tmpVic (c 5)) ] ] ] [ showmenu stats ]
menuitemvar [ if (> (strlen $tmpKBR) 3) [ concat (c 9) Current reason: (concatword (c 5) $tmpKBR) ] ]
menuitemtextinput "Enter a reason: " "" [ tmpKStr = ""; loop gkl $numargs [ if (> $numargs 0) [ tmpKStr = (concatword $tmpKStr (getalias (format arg%1 $gkl)) " ") ] ]; if (< $numargs 2) [ tmpKBR = $arg1 ] [ tmpKBR = $tmpKStr ]; refreshKBM 1 ] 0 256
menuitem "" -1
menuitemvar [ concat (c 9) Use a predefined reason: ]
menuitem "" -1
menuitem "Lag" [ tmpKBR = "lagging"; refreshKBM 1 ]
menuitem "Away from keyboard" [ tmpKBR = "AFK/not playing"; refreshKBM 1 ]
menuitem "Vote abuse" [ tmpKBR = "kick/ban/other vote abuse"; refreshKBM 1 ]
menuitem "Avoiding kicks/bans" [ tmpKBR = "avoiding kicks/bans"; refreshKBM 1 ]
menuitem "Private match" [ tmpKBR = (concat sorry, organizing a private (concatword match ", " (findpn $tmpVic))); refreshKBM 1 ]
menuitem "Obvious cheat" [ tmpKBR = "blatant cheating"; refreshKBM 1 ]
menuitem "Friendly fire/TK" [ if (curmodeattr team) [ tmpKBR = "intentional teamkills/team damage" ] [ echo (c 3)Error: (c 5) (getmodeacr) is not a team mode. ]; refreshKBM 1 ]
menuitem "Spamming" [ tmpKBR = "spamming chat/voicecoms/etc."; refreshKBM 1 ]
menuitem "Poor/abusive behaviour" [ tmpKBR = "poor/abusive behaviour"; refreshKBM 1 ]
menuitem "Inappropriate language" [ tmpKBR = "inappropriate language"; refreshKBM 1 ]
menuitem "Inappropriate name" [ tmpKBR = (concat inappropriate name (addpunct (findpn $tmpVic) 2)); refreshKBM 1 ]
menuitem "" -1
menuitemvar [ concat (c 9) Action: ]
menuitem "" -1
menuitemvar [ concat (c 2)Kick ] [ if (> (strlen $tmpKBR) 3) [ if $votepending [ if (currole) [ vote 2 ]; sleep 250 [ kick $tmpVic $tmpKBR ] ] ] [ kick $tmpVic $tmpKBR ] ]
menuitemvar [ concat (c 3)Ban ] [ if (> (strlen $tmpKBR) 3) [ if $votepending [ if (currole) [ vote 2 ]; sleep 250 [ ban $tmpVic $tmpKBR ] ] ] [ ban $tmpVic $tmpKBR ] ]
menuitemvar [ concat (c 9)Forceteam ] [ if (curmodeattr team) [ forceteam $tmpVic ] [ echo (c 3)Error: (c 5) (getmodeacr) is not a team mode. ] ]
menuitemvar [ concat (c 1)Whois ] [ whois $tmpVic ]
menuitem "Spectate" [ if (&& $connected (> (curplayers) 1)) [ if (alive) [ suicide ]; sleep 50 [ togglespect ]; sleep 100 [ setfollowplayer $tmpVic ] ] [ echo (c 3)Error: (c 5)Not connected or not enough players. ] ]
menuitemvar [ concat (c 0)Refresh] [ refreshKBM 1 ]
menuitem "" -1
menuitem "Back" [ closemenu reason ]
newmenu stats
menuitemvar [ concat (c 9)Current statistics for client: (c 5) (findpn $tmpVic) (c 2) (addpunct $tmpVic 2) ]
menuitemvar [ if (curmodeattr team) [ concat Team: (at (concat (concatword (c 3) CLA) (concatword (c 1) RVSF)) (at (pstat_score $tmpVic) 4)) ] [ concat Mode: (c 2) (getmodeacr) ] ]
menuitemvar [ if (curmodeattr team) [ concat Teamkills: (c 3) (at (pstat_score $tmpVic) 5) ] ]
menuitemvar [ if (curmodeattr flag) [ concat Flags: (at (pstat_score $tmpVic) 0) ] [ concat Flags: N/A ] ]
menuitemvar [ concat Frags: (at (pstat_score $tmpVic) 1) ]
menuitemvar [ concat Deaths: (at (pstat_score $tmpVic) 2) ]
menuitemvar [ if $connected [ concat Score: (at (pstat_score $tmpVic) 3) ] [ concat Score: N/A ] ]
menuitem "" -1
menuitem "Refresh" [ closemenu stats; sleep 0 [ showmenu stats ] ]
menuitem "Back" [ closemenu stats ]
addListOnQuit "hvcOutput tmpArg1 tmpKArg tmpKBP tmpVic votepending"