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
setweaponCategories
Parameters
- player (1-32): id of a player
- weapon (1-255): type id (int) or name (string) of a weapon
Info
Set the active weapon a certain player holds in his hand (as server only).
The name can be the displayed name or a simplified version (lowercase without whitespaces/special characters, just letters and numbers)
Weapon and item IDs:
Usage examples (setting weapon of player 1 here, which is always you when using "New Game"):
setweapon 1 51 // ID
setweapon 1 "Molotov Cocktail" // full name
setweapon 1 ak47 // simplified name
setweapon 1 fiveseven // simplified name
Note: The player has to own this weapon already! Use equip first if the player does not have the weapon!
Note: Don't confuse this command with the weapon command! The weapon command can only be used locally by a client to change the weapon of the own player!
Lua Hooks
Lua Commands
Categories
Parameters
- player (1-32): id of a player
- weapon (1-255): type id (int) or name (string) of a weapon
Info
Set the active weapon a certain player holds in his hand (as server only).
The name can be the displayed name or a simplified version (lowercase without whitespaces/special characters, just letters and numbers)
Weapon and item IDs:
Usage examples (setting weapon of player 1 here, which is always you when using "New Game"):
The name can be the displayed name or a simplified version (lowercase without whitespaces/special characters, just letters and numbers)
Weapon and item IDs:
Usage examples (setting weapon of player 1 here, which is always you when using "New Game"):
setweapon 1 51 // ID
setweapon 1 "Molotov Cocktail" // full name
setweapon 1 ak47 // simplified name
setweapon 1 fiveseven // simplified name
Note: The player has to own this weapon already! Use equip first if the player does not have the weapon!
Note: Don't confuse this command with the weapon command! The weapon command can only be used locally by a client to change the weapon of the own player!