Usage

Object syntax: player.varname, player.functionname()

Explanation

The player object refers to the current player (a TServerPlayer; same as the type of player object returned by findplayer()).

Inside event functions, this normally represents the player who caused the event. For instance, in an onPlayerEnters event, the player object will refer to the player who entered the level.

Normally this is automatically updated by the script engine. However, some script commands like sleep() will cause the engine to "lose focus" on the player.

Example

function onPlayerEnters()
{
  echo("Hello " @ player.account);
}


Categories

CategoryBuiltInVariable
CategoryVariablePrefix

There are 18 comments on this page. [Display comments]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki