GetPlayerDexterity 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 returns player's dexterity.

Syntax

int getPlayerDexterity(int id);

Parameters

  • id: The ID of player.

Returns

  • Return player's dexterity.

Example

Client

local function onCommandHandler(cmd, params)
{
    if (cmd == "dex")
    {
        local dex = getPlayerDexterity(heroId);
        print("My dexterity: " + dex);
    }
}

addEventHandler("onCommand", onCommandHandler);

Server

local function onPlayerCommandHandler(pid, cmd, params)
{
    if (cmd == "dex")
    {
        local dex = getPlayerDexterity(pid);
        sendMessageToPlayer(pid, 255, 255, 255, "My dexterity: " + dex);
    }
}

addEventHandler("onPlayerCommand", onPlayerCommandHandler);

Related functions

Server

Shared