SetPlayerDexterity 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 dexterity to player.

Syntax

void setPlayerDexterity(int pid, int dex)

Parameters

  • id: The ID of player.
  • dex: New dexterity.

Example

Client

local function onCommandHandler(cmd, params)
{
    if (cmd == "dex")
    {
        local args = sscanf("d",params);
        setPlayerDexterity(heroId,args[0]);
    }
}

addEventHandler("onCommand", onCommandHandler);

Server

local function onPlayerCommandHandler(pid, cmd, params)
{
    if (cmd == "dex")
    {
        local args = sscanf("dd",params);
        setPlayerDexterity(args[0],args[1]);
    }
}

addEventHandler("onPlayerCommand", onPlayerCommandHandler);

Related functions

Server

Shared