hasInterface: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(populated)
 
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(69 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2oa |= Game name
|game1= arma2oa
|version1= 1.63


|1.63|= Game version
|game2= tkoh
____________________________________________________________________________________________
|version2= 1.00


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


| '''hasInterface''' |= Syntax
|gr1= Multiplayer


| [[Boolean]] |= Return value
|descr= Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client.
____________________________________________________________________________________________
 
|x1= <code>headless <nowiki>=</nowiki> ! ( '''hasInterface''' <nowiki>||</nowiki> isDedicated ) </code> |= Example 1
____________________________________________________________________________________________


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


|r1= [[Boolean]]
|x1= <sqf>_isHC = !(hasInterface || isDedicated);</sqf>
|x2= <sqf>_isHC = !hasInterface && !isDedicated;</sqf>
|seealso= [[isDedicated]] [[isServer]]
}}
}}


<h3 style="display:none">Notes</h3>
 
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->


<dt></dt>
<dd class="notedate">Posted on 2014-12-21 - 14:55 (UTC)</dd>
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
<dd class="note">
<sqf>
if (isDedicated) then {
//run on dedicated server only
};


if (isServer) then {
//run on dedicated server or player host
};


<!-- Note Section END -->
if (hasInterface) then {
</dl>
//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
};


<h3 style="display:none">Bottom Section</h3>
if (!hasInterface && !isDedicated) then {
//run on headless clients only
};
</sqf>
</dd>


[[Category:ArmA 2 OA: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
</dl>
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:43, 3 September 2024

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:
isDedicated isServer

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


Posted on 2014-12-21 - 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 };