1,543
edits
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...") |
DrinkyBird (talk | contribs) No edit summary Tag: Source edit |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
int '''ConsolePlayerNumber''' (void) | int '''ConsolePlayerNumber''' (void) | ||
==Usage== | == Usage == | ||
=== Return value === | |||
Returns the number of the local player. Returns -1 if called on the server. This function is only really meaningful in client-side scripting. | 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. | Note that in a DISCONNECT script, ConsolePlayerNumber() will return the last player number the local player had, even though PlayerNumber() no longer works. | ||
==Examples== | == Examples == | ||
This script tells the player what | This script tells the player what their player number is: | ||
<syntaxhighlight lang="c" line="1"> | |||
Script 1 (void) NET CLIENTSIDE | |||
{ | |||
PrintBold(s: "My player number is ", d: ConsolePlayerNumber()); | |||
} | |||
</syntaxhighlight> | |||
[[Category:ACS | [[Category:ACS functions]] |