SetPlayerSkillWeapon Shared function

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

This function was added in version: Client: 0.0.4.1, Server: 0.0.0

This function sets new weapon skill to player.

Syntax

void setPlayerSkillWeapon(int id, int skill_id, int value)

Parameters

  • id: The ID of player.
  • skill_id: The ID of skill (Constants).
  • value: Value of skill in (in %).

Example

Client

local function onCommandHandler(cmd, params)
{
    if (cmd == "skill")
    {
        local args = sscanf("dd",params);
        local skill = args[0];
        local value = args[1];
        setPlayerSkillWeapon(heroId,skill,value);
    }
}

addEventHandler("onCommand", onCommandHandler);

Server

local function onPlayerCommandHandler(pid, cmd, params)
{
    if (cmd == "skill")
    {
        local args = sscanf("ddd",params);
        local skill = args[1];
        local value = args[2];
        setPlayerSkillWeapon(args[0],skill,value);
    }
}

addEventHandler("onPlayerCommand", onPlayerCommandHandler);

Related functions

Server

Shared