ConsolePlayerNumber

From Zandronum Wiki
Revision as of 15:07, 21 August 2016 by DrinkyBird (talk | contribs) (Created page with "{{Template:ACSWarning}} int '''ConsolePlayerNumber''' (void) ==Usage== Returns the number of the local player. Returns -1 if called on the server. This function is only real...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

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:

script 1 (void) net clientside {
  {{{2}}}(s:"My player number is ", d:ConsolePlayerNumber());
}