ConsolePlayerNumber

From Zandronum Wiki
Jump to: navigation, search
Zandronum SkulltagOverlay.png Warning: This feature is Zandronum specific and may not supported by ZDoom and its other child ports!
Documentation may not be accurate, see ACS Functions.

int ConsolePlayerNumber (void)

Usage

Returns the number of the local player. Returns -1 if called on the server. This function is only really meaningful in client-side scripting.

Note that in a DISCONNECT script, ConsolePlayerNumber() will return the last player number the local player had, even though PlayerNumber() no longer works.

Examples

This script tells the player what his player number is:

1 Script 1 (void) NET CLIENTSIDE
2 {
3     PrintBold(s: "My player number is ", d: ConsolePlayerNumber());
4 }