Commands/Lua

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

CS2D Command CS2D Console Commands

CS2D Command setammo

Categories

Parameters

  • id (1-X): player id (or dropped item id)
  • weapon (0-255): weapon type (or 0 if dropped item id is specified as first parameter)
  • ammoin (0-1000): ammo in weapon (or 1000 to keep unchanged)
  • ammo (0-1000): spare ammo (or 1000 to keep unchanged)

Info

Changes the amount of ammunition for a weapon.
It works for weapons which are dropped on the ground or which are currently carried by a player.

  • To change ammo of a weapon carried by a player: id = player ID, weapon = weapon type (see list below)

  • To change ammo of a dropped weapon on the map: id = item ID on map, weapon = 0


You can set the ammo which will be loaded in the weapon (ammoin) and spare ammo (ammo) which can be reloaded. Use the value 1000 to keep the current ammo value unchanged (in case you only want to change one of two values).

Weapon and item IDs:
items

Note: You can use the value 1000 for ammoin and ammo to keep the current value unchanged.

Note: Maximum values are limited by the weapon attributes. You can't put more ammo into a weapon than it normally holds.

Attention: The first parameter can be either a player ID or the ID of a dropped item! If you specify the ID of a dropped item, the second parameter must be 0!

Lua Hook Lua Hooks

Lua Command Lua Commands