hasInterface: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)\]\]" to "{{GameCategory|arma2|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma2oa |Game name=
| arma2oa |Game name=
Line 9: Line 8:




____________________________________________________________________________________________


| Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client. |Description=
| Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client. |Description=
____________________________________________________________________________________________


| [[hasInterface]] |Syntax=
| [[hasInterface]] |Syntax=


| [[Boolean]] |Return value=
| [[Boolean]] |Return value=
____________________________________________________________________________________________
   
   
|x1= <code>_isHC = !([[hasInterface]] <nowiki>||</nowiki> [[isDedicated]]);</code> |Example 1=
|x1= <code>_isHC = !([[hasInterface]] <nowiki>||</nowiki> [[isDedicated]]);</code> |Example 1=


|x2= <code>_isHC = ![[hasInterface]] && ![[isDedicated]];</code> |Example 2=
|x2= <code>_isHC = ![[hasInterface]] && ![[isDedicated]];</code> |Example 2=
____________________________________________________________________________________________


| [[isDedicated]], [[isServer]] |See also=
| [[isDedicated]], [[isServer]] |See also=

Revision as of 01:33, 17 January 2021

Hover & click on the images for description

Description

Description:
Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client.
Groups:
Multiplayer

Syntax

Syntax:
hasInterface
Return Value:
Boolean

Examples

Example 1:
_isHC = !(hasInterface || isDedicated);
Example 2:
_isHC = !hasInterface && !isDedicated;

Additional Information

See also:
isDedicatedisServer

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section

Posted on December 21, 2014 - 14:55 (UTC)
Killzone Kid
if (isDedicated) then { //run on dedicated server only }; if (isServer) then { //run on dedicated server or player host }; if (hasInterface) then { //run on all player clients incl. player host }; if (!isDedicated) then { //run on all player clients incl. player host and headless clients }; if (!isServer) then { //run on all player clients incl. headless clients but not player host }; if (!hasInterface) then { //run on headless clients and dedicated server }; if (!hasInterface && !isDedicated) then { //run on headless clients only };