Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- Console Commands are entered in console, executed with key-binds, cfg-files or with Lua parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands
Category: security (15)
mp_luamapCategories
Parameters
- use (0/1): use Lua map script if available or not
Info
High Security Relevance
This setting is important for the security of your server!
Use it carefully! Wrong settings may make your server vulnerable or limit its functionality or accessibility!
Each map can have its own Lua script (also called "map script") which is saved as maps/MAPNAME.lua. A script for the map de_dust (maps/de_dust.map) would have to be saved as maps/de_dust.lua for example. By default (mp_luamap 0) CS2D does not load this script. You can enable automatic loading of map scripts by setting mp_luamap to 1.
Moreover this setting affects Lua scripts which are embedded in maps directly. This is currently only possible with the entity trigger_if which can have a boolean Lua expression. This expression will not be evaluated if mp_luamap is 0. In this case trigger_if will do nothing (it will neither run the Lua script nor run its triggers).
Note: Changes to this setting do NOT affect the currently loaded map. So if the map Lua script for the current map is (not) loaded, it won't be (un-)loaded by changing this setting. You have to load the map again AFTER changing this setting to (un-)load the map Lua script.
Attention: Setting mp_luamap to 1 is a security risk because CS2D can execute downloaded map scripts which may contain malicious scripts! This can only happen when you host your own server (dedicated or "New Game" option) with downloaded maps.
Lua Hooks
Lua Commands
Categories
Parameters
- use (0/1): use Lua map script if available or not
Info
High Security Relevance
This setting is important for the security of your server!
Use it carefully! Wrong settings may make your server vulnerable or limit its functionality or accessibility!
This setting is important for the security of your server!
Use it carefully! Wrong settings may make your server vulnerable or limit its functionality or accessibility!
Each map can have its own Lua script (also called "map script") which is saved as maps/MAPNAME.lua. A script for the map de_dust (maps/de_dust.map) would have to be saved as maps/de_dust.lua for example. By default (mp_luamap 0) CS2D does not load this script. You can enable automatic loading of map scripts by setting mp_luamap to 1.
Moreover this setting affects Lua scripts which are embedded in maps directly. This is currently only possible with the entity trigger_if which can have a boolean Lua expression. This expression will not be evaluated if mp_luamap is 0. In this case trigger_if will do nothing (it will neither run the Lua script nor run its triggers).
Note: Changes to this setting do NOT affect the currently loaded map. So if the map Lua script for the current map is (not) loaded, it won't be (un-)loaded by changing this setting. You have to load the map again AFTER changing this setting to (un-)load the map Lua script.
Attention: Setting mp_luamap to 1 is a security risk because CS2D can execute downloaded map scripts which may contain malicious scripts! This can only happen when you host your own server (dedicated or "New Game" option) with downloaded maps.