-
Notifications
You must be signed in to change notification settings - Fork 105
Scripting
Enabling scripting:
cmd_scripting 1
This is archive cvar, it will be saved.
Console variables (or CVars) are present in all quake-based games.
By deefault, it is settings, created by engine, server or client libraries.
But you can use set command to define variiables even if they are not created by engine.
For example, you can set cvar before it is registered in code.
set defaultmap crossfire
This works even in server.cfg before server cvars initialization
Alias allows to define new commands.
alias wnext "invnext;wait;wait;+attack;wait;-attack"
You can hook any command by adding alias to it and unaliasing it, when you want to use original command.
alias invnext1 "unalias invnext;wnext;alias invnext invnext1"
alias invnext invnext1
This is extension of xash3d fork, that can be enabled by cmd_scripting cvar
You can substitute cvar value to any command by adding $ symbol:
echo $sv_cheats
Other extension, that allows check cvar values.
if <value1> <operator> <value2>
:<action1>
:if <value3>
::<action2>
:<action3>
- Values are any string or numeric values (for example, substituted cvars).
- Operator is = (or ==), !=, <, >, <=, >=. == is same to =.
- If single value specified, condition is true when value is non-zero
Example:
if $sv_cheats == 1
:echo Cheats enabled, adding cheat menu
:exec cheatmenu.cfg