SetPlayerInstance Client function

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

This function was added in version: 0.0.4.1

Sets new instance of the player, for example "PC_HERO" for humans, or "GOBBO_GREEN" for green goblins.

Syntax

void setPlayerInstance(int pid, string instance)

Required Arguments

  • id: id of the player whom need to change instance.
  • instance: new instance.

Example

function onPlayerCommand(cmd, params) {
   if (cmd == "instance") {
      local args = sscanf("s",params);
      setPlayerInstance(heroId,args[0]);
   }
}

addEventHandler("onPlayerCommand",onPlayerCommand);

Related functions

Template:CPlayer Function