scripting:reference:system_functions:playerstatusfunctions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scripting:reference:system_functions:playerstatusfunctions [2020/01/29 06:42] – [sysIsInTown] mit | scripting:reference:system_functions:playerstatusfunctions [2023/04/15 14:00] (current) – mit | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | === Player | + | === Player |
- | System functions that provide you information about the player | + | |
+ | Most of the information about the player who has triggered the script event is available through [[scripting: | ||
- | ==== sysGetNearestPlayer ==== | + | These system functions can provide information about other players or query extra information about the context |
- | ^ Format | sysGetNearestPlayer( [WorldX], [WorldY] )| | + | |
- | ^ Description | Returns the ID of the player | + | |
- | ^ Parameters | World Coordinate X,Y | | + | |
- | ^ Returns | Player ID | | + | |
- | // | + | |
- | < | + | |
- | $kSpecialBuildingRecordNum = 10 | + | |
- | + | ||
- | Event( " | + | |
- | { | + | |
- | SetBuildingContext( $kSpecialBuildingRecordNum ) | + | |
- | $posX = $gBuildingWorldX | + | |
- | $posY = $gBuildingWorldY | + | |
- | + | ||
- | $targetPlayerID = sysGetNearestPlayer( $posX, $posY ) | + | |
- | $targetPlayerName = sysGetPlayerName( $targetPlayerID ) | + | |
- | *say %PLAYER% used the plunger. The person closest to the special building was $targetPlayerName | + | |
- | *explodebuilding $kSpecialBuildingRecordNum | + | |
- | } | + | |
- | </ | + | |
- | </ | + | |
==== sysGetPlayerID ==== | ==== sysGetPlayerID ==== | ||
- | ^ Format | sysGetPlayerID( | + | ^ Format | sysGetPlayerID( Player Name )| |
^ Description | Returns the ID for a specified player name | | ^ Description | Returns the ID for a specified player name | | ||
- | ^ Parameters | Player Name | | ||
^ Returns | Player ID | | ^ Returns | Player ID | | ||
// | // | ||
Line 43: | Line 21: | ||
*msg %PLAYER% Bob's player ID is $playerID | *msg %PLAYER% Bob's player ID is $playerID | ||
} | } | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== sysGetPlayerName==== | ||
+ | ^ Format | sysGetPlayerName( PlayerID )| | ||
+ | ^ Description | Returns the name for a specified player ID | | ||
+ | ^ Returns | Player Name | | ||
+ | // | ||
+ | < | ||
+ | { | ||
+ | $name = sysGetPlayerID( $gServerKey[StoredPlayerID] ) | ||
+ | *msg %PLAYER% The player ID stored in the server key is for the player name $name | ||
} | } | ||
</ | </ | ||
Line 49: | Line 40: | ||
==== sysIsPlayerIDOnline ==== | ==== sysIsPlayerIDOnline ==== | ||
- | ^ Format | sysIsPlayerIDOnline( | + | ^ Format | sysIsPlayerIDOnline( Player ID )| |
^ Description | Used to determine if the specified player is currently online on the world | | ^ 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 | | ^ Returns | **1** if the player is connected, **0** if not | | ||
^ Example | '' | ^ Example | '' | ||
==== sysIsInSpawnZone ==== | ==== sysIsInSpawnZone ==== | ||
- | ^ Format | sysIsInSpawnZone( | + | FIXME: This function name is inconsistent, |
+ | ^ Format | sysIsInSpawnZone( | ||
^ Description | Used to determine if the current player is within the specified spawn zone region | | ^ 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 | | ^ Returns | **1** if the player is in the region, **0** if not | | ||
^ Example | '' | ^ Example | '' | ||
Line 78: | Line 68: | ||
Example : '' | Example : '' | ||
Returns **1** if the player is currently learning the specified skill, **0** if not. \\ | Returns **1** if the player is currently learning the specified skill, **0** if not. \\ | ||
+ | |||
+ | ==== sysNumPlayersWithPlayerVarVal ==== | ||
+ | Example : '' | ||
+ | // | ||
+ | |||
+ | ==== sysGenerateTopPlayerVarsList ==== | ||
+ | ^ Format | sysGenerateTopPlayerVarsList( VarNum, Num_players_to_list )| | ||
+ | ^ Description | Generates a list of players sorted by the $gPlayerVar selcted. e.g. '' | ||
+ | ^ Returns | The number of players actually added to the list. (Only players with the PlayerVar above 0 get added) | | ||
+ | \\ | ||
+ | |||
+ | ==== sysGetTopPlayer ==== | ||
+ | ^ Format | sysGetTopPlayer ( List_Index )| | ||
+ | ^ Description | Access the list of top players generated using sysGenerateTopPlayerVarsList. List_Index starts at 0, so '' | ||
+ | ^ Returns | PlayerID | | ||
+ | // | ||
+ | // | ||
+ | |||
+ | ==== sysGetPlayerListScore ==== | ||
+ | ^ Format | sysGetPlayerListScore ( PlayerID )| | ||
+ | ^ Description | Returns the ' | ||
+ | ^ Returns | Score value | | ||
+ | FIXME : Separate below into separate PlayerListScore page: | ||
+ | *settings PlayerListMode | ||
+ | commands *incplayerlistscore, | ||
+ | Related Subgame functions: | ||
+ | SubgameActivatePlayerListScores( SubgameID, Mode )\\ | ||
+ | SubgameGetHighestPlayerListScore( SubgameID )\\ | ||
+ | SubgameNumPlayersWithPlayerListScore( SubgameID, Score )\\ | ||
+ | SubgameGetPlayerWithPlayerListScore( SubgameID, Score, Index )\\ | ||
+ | // | ||
+ | < | ||
+ | </ | ||
+ | TBD // | ||
+ | // | ||
+ | |||
+ | |||
scripting/reference/system_functions/playerstatusfunctions.1580301724.txt.gz · Last modified: 2020/01/29 06:42 by mit