GetPlayerTalent

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

This function returns if player's talent is learnt or not. Lists of available talents can be found here.

Syntax

int getPlayerTalent(int pid, int talent_id);

Parameters

  • pid: The ID of player.
  • talent_id: The ID of talent.

Example

local function onPlayerCommandHandler(pid, cmd, params)
{
    if (cmd == "talent")
    {
        local args = sscanf("dd", params);
        local talent = getPlayerTalent(pid, args[1]);
        sendMessageToPlayer(pid, 255, 255, 255, "The value of talent " + args[1] + " is " + talent);
    }
}
addEventHandler("onPlayerCommand", onPlayerCommandHandler);

Related functions