GetPlayerInfo

From ZDoom Wiki

Jump to: navigation, search

int GetPlayerInfo (int playernumber, int playerinfo)

Usage

Retrieves player-related information. To get information for the player who activated the script, use the PlayerNumber function.

Parameters

  • playernumber
The player to get the information from.
  • playerinfo
One of:
  • PLAYERINFO_TEAM
Which team the player is on. No team is 255 always. Without use of the TEAMINFO lump the teams are: 0 for blue, 1 for red, 2 for green, 3 for gold, 4 for black, 5 for white, 6 for orange or 7 for purple.
  • PLAYERINFO_AIMDIST
How far the player autoaims.
  • PLAYERINFO_COLOR
The player's color, as 0xRRGGBB in hexadecimal.
  • PLAYERINFO_GENDER
The player's gender: 0 for male, 1 for female, and 2 for other.
  • PLAYERINFO_NEVERSWITCH
The player's neverswitchonpickup setting.
  • PLAYERINFO_MOVEBOB
The player's movebob setting.
  • PLAYERINFO_STILLBOB
The player's stillbob setting.
  • PLAYERINFO_PLAYERCLASS
A number representing the player's class. In Hexen, this is 0 for the fighter, 1 for the cleric, and 2 for the mage. Note that this is the player class the player has selected (playerclass cvar), not necesarilly the one the player is currently playing with - to get the current player class number, use PlayerClass.

Return value

Returns the value of the given property of the specified player. If you ask for information about a player who is not in the game, it will return -1. If you ask for an unknown information it will return 0.

Examples

Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.
Personal tools