GrantPlayerSpell

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

grantPlayerSpell

Grants or clears a player spell. This is a readable alias of setPlayerSpellGranted.

Syntax

bool grantPlayerSpell(int playerId, int|string spell [, bool enabled = true])

Parameters

Name Type Required Description
playerId int yes The connected player to update.
spell string yes A spell id or stable key.
enabled bool no True to grant the spell, false to revoke it.

Returns

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

Examples

Grant Fire Arrow to a player:

grantPlayerSpell(playerId, SPELL.FIRE_ARROW, true)

Notes

  • Available only in server-side resource scripts.