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

This command 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. In case you want to change the ammo of a weapon carried by a player you have to specify the player and the weapon type. In case you want to change the ammo of a dropped weapon you have to specify its ID and the second parameter must be 0.
You can set the ammo which will be loaded in the weapon and spare ammo which can be reloaded. You can use 1000 as value to keep the actual ammo value unchanged (in case you only want to change one of the values). The ammo is restricted by the weapon attributes and will be limited automatically if you use values which are too high.

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 restricted by the weapon attributes. You can't use higher values.
Attention: The first parameter can be either a player ID or an item ID! This only depends on the second parameter which must be 0 if you want to specify a weapon ID!

Lua Hook Lua Hooks

Lua Command Lua Commands