IsMultiplayer: Difference between revisions

From Zandronum Wiki
(Made new page for IsNetworkGame, replacing the old "IsMultiplayer" page which is no longer valid.)
 
No edit summary
Tag: Source edit
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ACSWarning}}
{{ACSWarning}}
int '''IsNetworkGame''' (void)
int '''IsMultiplayer''' (void)


==Usage==
== Usage ==
=== Return value ===
This returns if the game is an online game (being emulated by the <tt>multiplayer</tt> [[Console Commands|console command]] does not count). It bears little relationship to the [[SinglePlayer]] and {{Zdoomwiki|GameType}} functions, except insofar as those will only report the game as singleplayer if it is ''offline'' Cooperative without multiplayer emulation.


This function checks if the game is an online game (being emulated by the Multiplayer [[Console Commands|Console Command]] does not count). It bears little relationship to the [[SinglePlayer]] and {{zdw|GameType}} functions, except insofar as those will only report the game as singleplayer if it is ''offline'' Cooperative without multiplayer emulation.
== Notes ==


==Bugs==
Old ACC builds used to call this <tt>PlayerOnTeam</tt>. This function is also sometimes seen as <tt>IsNetworkGame</tt>; which is the exact same function with an identical ACS p-code number.


No known issues, however old ACC builds used to call this PlayerOnTeam.
== Examples ==
 
==Examples==


<syntaxhighlight lang="c" line="1">
<syntaxhighlight lang="c" line="1">
Script 1 Enter
Script 1 ENTER
{
{
     if (IsNetworkGame())
     if (IsMultiplayer())
     {
     {
         Print(s: "Isn't multiplayer fun?");
         Print(s: "Isn't multiplayer fun?");
     }
     }
}
}
</syntaxhighlight >
</syntaxhighlight>


[[category:ACS Functions]]
[[category:ACS functions]]

Latest revision as of 18:43, 2 July 2022

This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

int IsMultiplayer (void)

Usage

Return value

This returns if the game is an online game (being emulated by the multiplayer console command does not count). It bears little relationship to the SinglePlayer and GameType functions, except insofar as those will only report the game as singleplayer if it is offline Cooperative without multiplayer emulation.

Notes

Old ACC builds used to call this PlayerOnTeam. This function is also sometimes seen as IsNetworkGame; which is the exact same function with an identical ACS p-code number.

Examples

Script 1 ENTER
{
    if (IsMultiplayer())
    {
        Print(s: "Isn't multiplayer fun?");
    }
}