Skip to content
Contractsv1.9.0

Command

⭐ Premium

Executes a server console command when the reward is claimed. This is the escape hatch for granting anything the other reward types can’t: kits, ranks, custom plugin actions. Technically, all rewards can be achieved with the Command reward!

{
"type": "Command",
"title": "Supply signal",
"description": "",
"eligiblePermissions": ["contracts.vip"],
"command": "inventory.giveto supply.signal {playerId} 1",
"icon": null,
"iconColor": null,
"iconRaw": false
}
FieldTypeDescription
typestringExactly 'Command'
titlestringDisplay name. May be empty to use the reward type's default name (recommended for most rewards).
titleTranslationsmap | nullPer-language overrides for title, mapping a language code (like "fr" or "zh-CN") to the translated text. Players whose language has no entry (matched case-insensitively, no region fallback) or a blank one see title instead. null when there are none.
descriptionstringA short blurb of 1 to 3 sentences. May be empty.
descriptionTranslationsmap | nullPer-language overrides for description, mapping a language code (like "fr" or "zh-CN") to the translated text. Players whose language has no entry (matched case-insensitively, no region fallback) or a blank one see description instead. null when there are none.
eligiblePermissionsstring[]Permission strings that gate this reward, using any-of logic: a non-empty list grants the reward to any player holding at least one of the listed permissions. An empty array means everyone is eligible.
commandstringThe console command to run when the reward is claimed. Supports runtime placeholders such as {playerId} and {playerName}.
iconstring | nullDirect image URL for this reward's icon in the menu. Null (or omitted) keeps the default star icon, or the per-type Command override from the plugin config when one is set.
iconColorstring | nullColor for the icon, as hex (#rrggbb or #rrggbbaa), rgb() or rgba(). Null (or omitted) inherits the per-type or default color. Invalid colors warn at plugin load and render white.
iconRawbooleanSet true when the icon is a full-color image (a logo, custom art) so it renders in its own colors. When false the image renders as a solid color, which is right for monochrome icons.

Command rewards can grant anything, so a single default icon rarely fits. The icon, iconColor and iconRaw fields let each reward carry its own image: a reward granting Skill Tree XP and one granting a kit can look like what they give.

Each field falls back on its own. A null icon keeps the default image, a null iconColor keeps the default color, and the default here means the per-type Command entry from the plugin config’s UI icons when one is set, or the built-in star otherwise.

Set iconRaw to true when the image is full-color (a logo, item art, a plugin’s own icon). Without it the client renders the image as a single-color silhouette, which only looks right for monochrome icons. A raw icon with an iconColor still gets colored, and ineligible or locked rewards still dim.

The command string can include these placeholders, substituted at run time:

Placeholder Replaced with
{playerId} The player’s Steam ID
{playerName} The player’s display name
{qPlayerName} The player’s display name, wrapped in quotes
{playerX} The player’s X position
{playerY} The player’s Y position
{playerZ} The player’s Z position
  • The command runs on the server console, with the same authority as a server admin.
  • Use {qPlayerName} when a name with spaces must be passed as a single argument. Otherwise, some command might misinterpret the player’s name as multiple arguments.

Give 1000 XP to the completing player:

givexp {playerId} 1000 false

Give a hard heli signal to the completing player:

hsgive easy {playerId} 1

Give weed to the completing player:

ganja.give weed low_quality 10 {playerId}

Give 50 XP to the completing player:

xpgive {playerId} 50

This is what the Item Reward does.

Give 500 scrap to the completing player:

inventory.giveto scraps {playerId} 500

This is what the Economics Reward does.

Give $1000 to the completing player:

deposit {playerId} 1000

This is what the ServerRewards Reward does.

Give 2 RP to the completing player:

rp add {playerId} 2