GetPlayerCountry

From Zandronum Wiki
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.
This article documents an ACS function which is only available in development builds of Zandronum 3.2 and newer.

str GetPlayerCountry (int player, int type)

Usage

Returns the country that a player's connecting from.

Parameters

  • player: The player number to get the country of.
  • type: Type of format to return the country in:
  • PLAYERCOUNTRY_ALPHA2 (0)
The ISO 3166-1 alpha-2 country code (e.g. CA).
  • PLAYERCOUNTRY_ALPHA3 (1)
The ISO 3166-1 alpha-3 country code (e.g. CAN).
  • PLAYERCOUNTRY_NAME (2)
The full name of the country (e.g. Canada).

Return value

If the player's country is unknown (e.g. they're hiding it using cl_hidecountry or it's somehow unrecognized), then "N/A" is returned. Likewise, if the player's a bot or connecting from the same network as the server, then "LAN" is returned. Otherwise, the name of the country in the desired format is returned.

Examples

This article lists no examples, please add one.