GrantPlayerConsumable

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 12:44, 4 August 2026 by QCherry (talk | contribs) (Automatyczna aktualizacja dokumentacji funkcji)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

grantPlayerConsumable

Grants a supported authoritative consumable item to a player.

Syntax

bool grantPlayerConsumable(int playerId, string itemKey, int count)

Parameters

Name Type Required Description
playerId int yes The connected player receiving the item.
itemKey string yes A supported consumable key.
count int yes Quantity from 1 through 100.

Returns

Returns true when the item grant is accepted; otherwise returns false.

Examples

Grant three strong mana potions:

grantPlayerConsumable(playerId, "strong_mana_potion", 3)

Notes

  • Available only in server-side resource scripts.
  • The current implementation supports strong_mana_potion.