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

CS2D Command CS2D Console Commands

CS2D Command spawnitem



  • item (1-255): type id (int) or name (string) of an item
  • x (0-X): map x position (in tiles)
  • y (0-X): map y position (in tiles)
  • [ammoin] (0-X)(optional): custom ammo in weapon value
  • [ammo] (0-X)(optional): custom spare ammo value


Spawn an item at a certain position (in tiles) of the map (as server only). The item 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:

You can optionally specify custom ammo values with the ammoin and ammo parameters. If you do not specify these parameters the weapon will be spawned with default ammo values (this means: fully loaded and max spare ammo for firearms).

Usage examples:
spawnitem 51 5 5 // ID
spawnitem "Molotov Cocktail" 6 5 // full name
spawnitem ak47 7 5 // simplified name
spawnitem fiveseven 8 5 // simplified name
spawnitem deagle 5 5 1 22 // spawn deagle with 1 bullet in magazine and 22 spare ammo

Note: The position is defined in tiles and not in pixels!
Note: CS2D allows you to spawn multiple items at the same tile!

Lua Hook Lua Hooks

Lua Command Lua Commands