Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

CS2D Command equip

Categories

Parameters

  • player (1-32): id of a player
  • weapon (1-255): type id (int) or name (string) of a weapon

Info

Give a weapon to a player (as server only). The weapon can be specified using its ID or its name.
The name can be the displayed name or a simplified version (lowercase without whitespaces/special characters, just letters and numbers)

Weapon and item IDs:
items

Usage examples (equipping to player 1 here, which is always you when using "New Game"):
equip 1 51 // ID
equip 1 "Molotov Cocktail" // full name
equip 1 ak47 // simplified name
equip 1 fiveseven // simplified name


Note: When using equip, a player can carry multiple different primary and secondary weapons. This is not possible when simply collecting weapons in-game.

Note: A player can hold each weapon only one time. Equip the same weapon again to re-fill the ammunition of this weapon.

Attention: NEVER use the equip command in Lua spawn hooks! Spawn performs its own equips which can lead to problems. Use the return value of your hooked spawn function instead! Put the following at the end of the function:
return "weaponid,weaponid,weaponid,..."
with weaponid = type id of weapons you want to equip

Lua Hook Lua Hooks

Lua Command Lua Commands