SetPlayerTalent

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function sets the new value for player's talent. Lists of available talents can be found here.

Syntax

void setPlayerTalent(int pid, int talent_id, int value)

Parameters

  • pid: The ID of player.
  • talent_id: The ID of talent.
  • value: Value of talent (0-1).

Example

local function onPlayerCommandHandler(pid, cmd, params)
{
    if (cmd == "talent")
    {
        local args = sscanf("ddd", params);
        if (!args) {
            sendMessageToPlayer(pid, 255, 0, 0, "Wrong parameters!");
            return;
        }

        setPlayerTalent(args[0], args[1], args[2]);
    }
}
addEventHandler("onPlayerCommand", onPlayerCommandHandler);

Related functions