]> de.git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Custom-server-votes.md
rename all the configs
[xonotic/xonotic.wiki.git] / Custom-server-votes.md
1 You can use `addvote` command to add custom vote commands to your server. For example, suppose you want your players to be able to vote whether they want bots or not. This can be achieved using the following code:
2
3 ```
4 alias bots "minplayers 4"
5 addvote bots
6
7 alias nobots "minplayers 0"
8 addvote nobots
9 ```
10
11 Now players will be able to type `vcall bots` or `vcall nobots` which will start a vote to have those commands issued.
12
13 You can prefix the contents of an alias with `settemp` to make it be valid only for the current game. For example `alias nobots "settemp minplayers 0"`.
14
15 Here's example that allows voting common server types assuming your `server.cfg` doesn't force them (you get infinite recursion if it does):
16
17 ```
18 alias vanilla "exec ruleset-xonotic.cfg; exec server.cfg; endmatch"
19 addvote vanilla
20
21 alias instagib "exec ruleset-xonotic.cfg; exec server.cfg; g_instagib 1; g_grappling_hook 1; endmatch"
22 addvote instagib
23
24 alias overkill "exec ruleset-overkill.cfg; exec server.cfg; endmatch"
25 addvote overkill
26 ```