SetPlayerStrength 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 strength to player.

Syntax

void setPlayerStrength(int pid, int str)

Parameters

  • id: The ID of player.
  • str: New strength.

Example

Client

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

addEventHandler("onCommand", onCommandHandler);

Server

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

addEventHandler("onPlayerCommand", onPlayerCommandHandler);

Related functions

Server

Shared