User Tools

Site Tools


scripting:reference:system_functions:playerstatusfunctions

This is an old revision of the document!


Player Information Functions

System functions that provide you information about the player

sysGetPlayerID

Format sysGetPlayerID( [Player Name] )
Description Returns the ID for a specified player name
Parameters Player Name
Returns Player ID

Example:

Event( "Custom", "Special" )
{
    $playerID = sysGetPlayerID( "Bob" )
    if ( $playerID <= 0 )
    {
        *msg %PLAYER% Bob doesn't exist on this world
    }
    else
    {
        *msg %PLAYER% Bob's player ID is $playerID
    }
}

sysIsPlayerIDOnline

Format sysIsPlayerIDOnline( [Player ID] )
Description Used to determine if the specified player is currently online on the world
Parameters Player ID
Returns 1 if the player is connected, 0 if not
Example $isOnline = sysIsPlayerIDOnline(32)

sysIsInSpawnZone

FIXME: This function name is inconsistent, as it only acts on the context player it needs to be renamed to 'sysPlayerIsInSpawnZone'

Format sysIsInSpawnZone( [SpawnZone Type/ID] )
Description Used to determine if the current player is within the specified spawn zone region
Parameters SpawnZone Type/ID
Returns 1 if the player is in the region, 0 if not
Example $isInDefaultSpawnZone = sysIsInSpawnZone(0)

sysPlayerIsInTown

Example : $var = sysPlayerIsInTown(“Home Town”))
Returns 1 if the current player is within the boundaries of the specified town, 0 if not

sysNumPlayersOnTeam

Example : $var = sysNumPlayersOnTeam(3)
Returns the number of players currently online and in the specified team

sysPlayerSkillLevel

Example : $var = sysPlayerSkillLevel(“Farmer”)
Returns the current player's skill level for the skill named (0 means the player does not yet have this skill)

sysPlayerIsLearningSkill

Example : $isLearning = sysPlayerIsLearningSkill(“Farmer”)
Returns 1 if the player is currently learning the specified skill, 0 if not.

scripting/reference/system_functions/playerstatusfunctions.1580302109.txt.gz · Last modified: 2020/01/29 06:48 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki