From ZDoom Wiki
Jump to: navigation, search

int GetPlayerInfo (int playernumber, int playerinfo)


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


  • playernumber
The player to get the information from.
  • playerinfo
One of:
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.
How far the player autoaims.
The player's color, as 0xRRGGBB in hexadecimal.
The player's gender: 0 for male, 1 for female, and 2 for other.
The player's neverswitchonpickup setting.
The player's movebob setting.
The player's stillbob setting.
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.
  • PLAYERINFO_FOV (New from 2.7.1)
The player's current FOV.
  • PLAYERINFO_DESIREDFOV (New from 2.7.1)
The player's fov setting.

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.


This script opens a door only if the player is Female:

script 1 (void)
	if(GetPlayerInfo(PlayerNumber(), PLAYERINFO_GENDER) == 1)
		Door_Open(1, 20);
		Print(s:"sorry dude, ladies only");