]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - commands.cfg
Fix many various things, including *ACTUALLY* fixing GetIndexedEntity
[xonotic/xonotic-data.pk3dir.git] / commands.cfg
1 // =================================================================
2 //  Master config for managing various command aliases and settings
3 // =================================================================
4
5 // Execute commands based on whether it is dedicated a server or a client.
6 alias "_detect_dedicated_$qport" "${* asis}"
7 alias "_detect_dedicated_0" ""
8 alias _if_dedicated "_detect_dedicated_$qport ${* asis}"
9 alias if_client "${* asis}"
10 alias if_dedicated "${* asis}"
11 _if_dedicated alias if_client ""
12 if_client alias if_dedicated ""
13
14 if_dedicated "alias" qc_cmd_sv     "sv_cmd $$*"
15 if_client    "alias" qc_cmd_cl     "cl_cmd $$*"
16 if_client    "alias" qc_cmd_cmd    "cmd $$*"
17 if_dedicated "alias" qc_cmd_svmenu "sv_cmd $$*"
18 if_client    "alias" qc_cmd_svmenu "menu_cmd $$*"
19 if_dedicated "alias" qc_cmd_svcl   "sv_cmd $$*"
20 if_client    "alias" qc_cmd_svcl   "cl_cmd $$*"
21 if_dedicated "alias" qc_cmd_svcmd  "sv_cmd $$*"
22 if_client    "alias" qc_cmd_svcmd  "cmd $$*"
23
24
25 // ========
26 //  common
27 // ========
28 // networked/server common commands
29 alias cvar_changes         "qc_cmd_svcmd  cvar_changes         ${* ?}" // Prints a list of all changed server cvars
30 alias cvar_purechanges     "qc_cmd_svcmd  cvar_purechanges     ${* ?}" // Prints a list of all changed gameplay cvars
31 alias info                 "qc_cmd_svcmd  info                 ${* ?}" // Request for unique server information set up by admin
32 alias ladder               "qc_cmd_svcmd  ladder               ${* ?}" // Get information about top players if supported
33 alias lsmaps               "qc_cmd_svcmd  lsmaps               ${* ?}" // List maps which can be used with the current game mode
34 alias lsnewmaps            "qc_cmd_svcmd  lsnewmaps            ${* ?}" // List maps which have no records or are seemingly unplayed yet
35 alias maplist              "qc_cmd_svcmd  maplist              ${* ?}" // Display full server maplist reply
36 alias rankings             "qc_cmd_svcmd  rankings             ${* ?}" // Print information about rankings
37 alias records              "qc_cmd_svcmd  records              ${* ?}" // List top 10 records for the current map
38 alias teamstatus           "qc_cmd_svcmd  teamstatus           ${* ?}" // Show information about player and team scores
39 alias time                 "qc_cmd_svcmd  time                 ${* ?}" // Print different formats/readouts of time
40 alias timein               "qc_cmd_svcmd  timein               ${* ?}" // Resume the game from being paused with a timeout
41 alias timeout              "qc_cmd_svcmd  timeout              ${* ?}" // Call a timeout which pauses the game for certain amount of time unless unpaused
42 alias vote                 "qc_cmd_svcmd  vote                 ${* ?}" // Request an action to be voted upon by players
43 alias who                  "qc_cmd_svcmd  who                  ${* ?}" // Display detailed client information about all players
44
45 // generic commands (across all programs)
46 alias addtolist            "qc_cmd_svmenu addtolist            ${* ?}" // Add a string to a cvar
47 alias dumpcommands         "qc_cmd_svmenu dumpcommands         ${* ?}" // Dump all commands on the program to *_cmd_dump.txt
48 alias maplist              "qc_cmd_svmenu maplist              ${* ?}" // Automatic control of maplist
49 alias removefromlist       "qc_cmd_svmenu removefromlist       ${* ?}" // Remove a string from a cvar
50 alias rpn                  "qc_cmd_svmenu rpn                  ${* ?}" // RPN calculator
51 //alias settemp            "qc_cmd_svmenu settemp              ${* ?}" // Temporarily set a value to a cvar which is restored later
52 //alias settemp_restore    "qc_cmd_svmenu settemp_restore      ${* ?}" // Restore all cvars set by settemp command
53
54 // other aliases for common commands
55 alias g_hitplots_add "qc_cmd_svmenu rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} union def"
56 alias g_hitplots_remove "qc_cmd_svmenu rpn /g_hitplots_individuals g_hitplots_individuals ${1 !} difference def"
57
58 alias g_maplist_add     "qc_cmd_svmenu maplist add ${* ?}"
59 alias g_maplist_remove  "qc_cmd_svmenu maplist remove ${* ?}"
60 alias g_maplist_putfirst        "qc_cmd_svmenu maplist remove ${* ?} ; qc_cmd maplist add ${* ?}"
61 alias g_maplist_shufflenow      "qc_cmd_svmenu maplist shuffle"
62 alias g_maplist_cleanup "qc_cmd_svmenu maplist cleanup" // removes maps that don't exist from the map list
63
64 alias addfav "qc_cmd_svmenu addtolist net_slist_favorites ${* ?}"
65 alias addvote "qc_cmd_svmenu addtolist sv_vote_commands ${* ?}"
66
67
68 // ========================
69 //  engine command aliases
70 // ========================
71 alias bsp "ls maps/*.bsp"
72 alias chmap "changelevel ${* ?}"
73 alias clearmap "disconnect"
74 alias ply "playdemo $1"
75 alias rec "record demos/${1 !}"
76 alias search "apropos ${* ?}"
77 alias sv_loadconfig "exec $serverconfig"
78 alias sv_restart "say \"Server will restart at the end of the match, you will all be reconnected automatically. ${* ?} \"; quit_and_redirect self"
79 alias tdem "timedemo $1"
80
81
82 // ===============================================
83 //  menu_cmd (menu command) - menu/command/menu_cmd.qc
84 // ===============================================
85 alias menu_showteamselect "menu_cmd directmenu TeamSelect"
86 alias menu_showhudexit "menu_cmd directmenu HUDExit"
87 alias menu_showhudoptions "menu_cmd directpanelhudmenu ${* ?}"
88 alias menu_showsandboxtools "menu_cmd directmenu SandboxTools"
89 alias menu_showquitdialog "menu_cmd directmenu Quit"
90
91 // command executed before loading a map by the menu
92 // makes sure maxplayers is at least minplayers or bot_number + 1
93 alias _menu_loadmap_prepare_maxpl "maxplayers $_menu_loadmap_maxplayers"
94 alias menu_loadmap_prepare "disconnect; wait; g_campaign 0; menu_cmd rpn /_menu_loadmap_maxplayers menu_maxplayers minplayers bot_number 1 add max max def; _menu_loadmap_prepare_maxpl; g_maplist_shufflenow"
95
96
97 // ==========================================================
98 //  cl_cmd (client local command) - client/command/cl_cmd.qc
99 // ==========================================================
100 // commented out commands are really only intended for internal use
101 alias blurtest             "qc_cmd_cl     blurtest             ${* ?}" // Feature for testing blur postprocessing
102 alias debugmodel           "qc_cmd_cl     debugmodel           ${* ?}" // Spawn a debug model manually
103 //alias handlevote         "qc_cmd_cl     handlevote           ${* ?}" // System to handle selecting a vote or option
104 alias hud                  "qc_cmd_cl     hud                  ${* ?}" // Commands regarding/controlling the HUD system
105 alias localprint           "qc_cmd_cl     localprint           ${* ?}" // Create your own centerprint sent to yourself
106 //alias mv_download        "qc_cmd_cl     mv_download          ${* ?}" // Retrieve mapshot picture from the server
107 alias sendcvar             "qc_cmd_cl     sendcvar             ${* ?}" // Send a cvar to the server (like weaponpriority)
108
109 // other aliases for local commands
110 alias hud_configure "qc_cmd_cl hud configure"
111 alias hud_save "qc_cmd_cl hud save ${* ?}"
112 alias radar "qc_cmd_cl hud radar ${* ?}"
113 alias scoreboard_columns_help "qc_cmd_cl hud scoreboard_columns_help"
114 alias scoreboard_columns_set "qc_cmd_cl hud scoreboard_columns_set ${* ?}"
115
116 // changes a cvar and reports it to the server (for the client to notify the server about changes)
117 alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
118
119
120 // ========================================================
121 //  cmd (client-to-server command) - server/command/cmd.qc
122 // ========================================================
123 set sv_clientcommand_antispam_time 1 "Amount of seconds after a command before another command can be called again without being considered spam. (Use -1 for no antispam limit)"
124 set sv_clientcommand_antispam_count 8 "Amount of commands considered spam before commands are rejected."
125 seta sv_status_privacy 1 "hide IP addresses from \"status\" and \"who\" replies shown to clients"
126 seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
127
128 // commented out commands are really only intended for internal use, or already have declaration in the engine
129 alias autoswitch           "qc_cmd_cmd    autoswitch           ${* ?}" // Whether or not to switch automatically when getting a better weapon
130 alias checkfail            "qc_cmd_cmd    checkfail            ${* ?}" // Report if a client-side check failed
131 alias clientversion        "qc_cmd_cmd    clientversion        ${* ?}" // Release version of the game
132 //alias getmapvotepic      "qc_cmd_cmd    getmapvotepic        ${* ?}" // Retrieve mapshot picture from the server
133 alias join                 "qc_cmd_cmd    join                 ${* ?}" // Become a player in the game
134 alias ready                "qc_cmd_cmd    ready                ${* ?}" // Qualify as ready to end warmup stage (or restart server if allowed)
135 alias reportcvar           "qc_cmd_cmd    reportcvar           ${* ?}" // Old system for sending a client cvar to the server
136 //alias say                "qc_cmd_cmd    say                  ${* ?}" // Print a message to chat to all players
137 //alias say_team           "qc_cmd_cmd    say_team             ${* ?}" // Print a message to chat to all team mates
138 alias selectteam           "qc_cmd_cmd    selectteam           ${* ?}" // Attempt to choose a team to join into
139 alias selfstuff            "qc_cmd_cmd    selfstuff            ${* ?}" // Stuffcmd a command to your own client
140 alias sentcvar             "qc_cmd_cmd    sentcvar             ${* ?}" // New system for sending a client cvar to the server
141 alias spectate             "qc_cmd_cmd    spectate             ${* ?}" // Become an observer
142 alias suggestmap           "qc_cmd_cmd    suggestmap           ${* ?}" // Suggest a map to the mapvote at match end
143 //alias tell               "qc_cmd_cmd    tell                 ${* ?}" // Send a message directly to a player
144 alias voice                "qc_cmd_cmd    voice                ${* ?}" // Send voice message via sound
145
146 // other aliases for client-to-server commands
147 alias autoswitch "set cl_autoswitch ${1 ?} ; cmd autoswitch ${1 ?}" // todo
148
149 alias team_red "cmd selectteam red; cmd join"
150 alias team_blue "cmd selectteam blue; cmd join"
151 alias team_pink "cmd selectteam pink; cmd join"
152 alias team_yellow "cmd selectteam yellow; cmd join"
153 alias team_auto "cmd selectteam auto; cmd join"
154
155 alias spec "spectate"
156
157 // mutator aliases
158 alias sandbox "cmd g_sandbox ${* ?}"
159
160
161 // ============================================================
162 //  sv_cmd (server console command) - server/command/sv_cmd.qc
163 // ============================================================
164 alias adminmsg             "qc_cmd_sv     adminmsg             ${* ?}" // Send an admin message to a client directly
165 alias allready             "qc_cmd_sv     allready             ${* ?}" // Restart the server and reset the players
166 alias allspec              "qc_cmd_sv     allspec              ${* ?}" // Force all players to spectate
167 alias anticheat            "qc_cmd_sv     anticheat            ${* ?}" // Create an anticheat report for a client
168 alias bbox                 "qc_cmd_sv     bbox                 ${* ?}" // Print detailed information about world size
169 alias bot_cmd              "qc_cmd_sv     bot_cmd              ${* ?}" // Control and send commands to bots
170 alias cointoss             "qc_cmd_sv     cointoss             ${* ?}" // Flip a virtual coin and give random result
171 alias database             "qc_cmd_sv     database             ${* ?}" // Extra controls of the serverprogs database
172 alias defer_clear          "qc_cmd_sv     defer_clear          ${* ?}" // Clear all queued defer commands for a specific client
173 alias defer_clear_all      "qc_cmd_sv     defer_clear_all      ${* ?}" // Clear all queued defer commands for all clients
174 alias delrec               "qc_cmd_sv     delrec               ${* ?}" // Delete race time record for a map
175 alias effectindexdump      "qc_cmd_sv     effectindexdump      ${* ?}" // Dump list of effects from code and effectinfo.txt
176 alias extendmatchtime      "qc_cmd_sv     extendmatchtime      ${* ?}" // Increase the timelimit value incrementally
177 alias find                 "qc_cmd_sv     find                 ${* ?}" // Search through entities for matching classname
178 alias gametype             "qc_cmd_sv     gametype             ${* ?}" // Simple command to change the active gametype
179 alias gettaginfo           "qc_cmd_sv     gettaginfo           ${* ?}" // Get specific information about a weapon model
180 alias gotomap              "qc_cmd_sv     gotomap              ${* ?}" // Simple command to switch to another map
181 alias lockteams            "qc_cmd_sv     lockteams            ${* ?}" // Disable the ability for players to switch or enter teams
182 alias make_mapinfo         "qc_cmd_sv     make_mapinfo         ${* ?}" // Automatically rebuild mapinfo files
183 alias moveplayer           "qc_cmd_sv     moveplayer           ${* ?}" // Change the team/status of a player
184 alias nospectators         "qc_cmd_sv     nospectators         ${* ?}" // Automatically remove spectators from a match
185 alias playerdemo           "qc_cmd_sv     playerdemo           ${* ?}" // Control the ability to save demos of players
186 alias printstats           "qc_cmd_sv     printstats           ${* ?}" // Dump eventlog player stats and other score information
187 alias radarmap             "qc_cmd_sv     radarmap             ${* ?}" // Generate a radar image of the map
188 alias reducematchtime      "qc_cmd_sv     reducematchtime      ${* ?}" // Decrease the timelimit value incrementally
189 alias setbots              "qc_cmd_sv     setbots              ${* ?}" // Adjust how many bots are in the match
190 alias shuffleteams         "qc_cmd_sv     shuffleteams         ${* ?}" // Randomly move players to different teams
191 alias stuffto              "qc_cmd_sv     stuffto              ${* ?}" // Send a command to be executed on a client
192 alias trace                "qc_cmd_sv     trace                ${* ?}" // Various debugging tools with tracing
193 alias unlockteams          "qc_cmd_sv     unlockteams          ${* ?}" // Enable the ability for players to switch or enter teams
194 alias warp                 "qc_cmd_sv     warp                 ${* ?}" // Choose different level in campaign
195
196 // other aliases for server commands
197 alias endmatch "timelimit -1"
198
199 alias savedb "sv_cmd database save \"${1 ?}\""
200 alias dumpdb "sv_cmd database dump \"${1 ?}\""
201 alias loaddb "sv_cmd database load \"${1 ?}\""
202
203 alias movetored "moveplayer ${1 ?} red"
204 alias movetoblue "moveplayer ${1 ?} blue"
205 alias movetopink "moveplayer ${1 ?} pink"
206 alias movetoyellow "moveplayer ${1 ?} yellow"
207 alias movetoauto "moveplayer ${1 ?} auto"
208
209
210 // =======================================================
211 //  Aliases for settemp subsystem. Warning: Do not touch. 
212 //  Usage: settemp variable value, next map resets it.
213 // =======================================================
214 alias settemp "qc_cmd_svcl settemp $$*"
215 alias settemp_restore "qc_cmd_svcl settemp_restore"
216
217
218 // ===================================
219 //  banning - server/command/ipban.qc
220 // ===================================
221 alias bans "sv_cmd bans"
222 alias ban "sv_cmd ban ${* ?}"         // usage: ban address(maybe incomplete, like 1.2.3) bantime(seconds)
223 alias kickban "sv_cmd kickban ${* ?}" // usage: kickban # playerno bantime(seconds) masksize(bytes)
224 alias unban "sv_cmd unban ${* ?}"     // usage: unban 3 (number from bans)
225
226
227 // =================================
228 //  voting - server/command/vote.qc
229 // =================================
230 set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
231 set sv_vote_change 1 "Allow voters to change their mind after already voting"
232 set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto" "these commands can be voted"
233 set sv_vote_only_commands ""
234 set sv_vote_master_commands "movetored movetoblue movetoyellow movetopink" "Commands which vote masters can execute by themselves" // maybe add kickban here (but then sv_vote_master 0)
235 set sv_vote_master 1    "Allows the use of the vote master system"
236 set sv_vote_master_callable 1 "When set, users can use \"vmaster\" to call a vote to become master of voting commands"
237 set sv_vote_master_password "" "when set, users can use \"vlogin PASSWORD\" to log in as master"
238 set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
239 set sv_vote_no_stops_vote 1 "Allow the vote caller to stop his own vote simply by voting no"
240 set sv_vote_singlecount 0       "set to 1 to count votes once after timeout or to 0 to count with every vote"
241 set sv_vote_timeout 30  "a vote will timeout after this many seconds"
242 set sv_vote_wait 120    "a player can not call a vote again for this many seconds when his vote was not accepted"
243 set sv_vote_stop 15     "a player can not call a vote again for this many seconds when he stopped this vote (e.g. to correct it)"
244 set sv_vote_majority_factor 0.5 "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
245 set sv_vote_majority_factor_of_voted 0.5 "What percentage of the VOTERS constitute a majority too? (Must be at least 0.5, recommended: 0.5)"
246 // when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
247 set sv_vote_override_mostrecent 0
248
249 alias vhelp "cmd vote help"
250 alias vstatus "cmd vote status"
251 alias vcall "cmd vote call ${* ?}"
252 alias vstop "cmd vote stop"
253 alias vmaster "cmd vote master"
254 alias vlogin "cmd vote login ${* ?}"
255 alias vdo "cmd vote do ${* ?}"
256 alias vyes "cl_cmd handlevote yes"
257 alias vno "cl_cmd handlevote no"
258 alias vdontcare "cmd vote dontcare"
259 alias vabstain "cmd vote abstain"
260
261 alias vmap "vcall gotomap ${1 ?}"
262 alias vnextmap "vcall nextmap ${1 ?}"
263 alias vkick "vcall kick ${1 ?}"
264 alias vkickban "vcall kickban ${1 ?}"
265 alias vend "vcall endmatch"
266 alias vdomap "vdo gotomap ${1 ?}"
267 alias vdokick "vdo kick ${* ?}"
268 alias vdokickban "vdo kickban ${* ?}"
269 alias vdoend "vdo endmatch"
270
271 // ======================
272 //  rcon server commands
273 // ======================
274 rcon_secure 1
275 set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban *\" status \"sv_cmd teamstatus\" movetoauto movetored movetoblue movetoyellow movetopink"
276
277 // =============================
278 //  other miscellaneous aliases
279 // =============================
280 alias autoscreenshot "screenshot screenshots/autoscreenshot/${1 !}-${2 !}.jpg; echo \"^5A screenshot has been taken at request of the server.\""
281