hasInterface: Difference between revisions

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


| arma2oa
|game1= arma2oa
|version1= 1.63


|1.63
|game2= tkoh
|version2= 1.00


|gr1 = Multiplayer
|game3= arma3
|version3= 0.50


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


| [[hasInterface]]
|descr= Returns true if the computer has an interface (a real player). False for a dedicated server or for a headless client.


| [[Boolean]]
|s1= [[hasInterface]]
 
|x1= <code>_isHC = !([[hasInterface]] <nowiki>||</nowiki> [[isDedicated]]);</code>


|x2= <code>_isHC = ![[hasInterface]] && ![[isDedicated]];</code>
|r1= [[Boolean]]


| [[isDedicated]], [[isServer]]
|x1= <sqf>_isHC = !(hasInterface || isDedicated);</sqf>
}}


<dl class="command_description">
|x2= <sqf>_isHC = !hasInterface && !isDedicated;</sqf>
<!-- Note Section BEGIN -->


|seealso= [[isDedicated]] [[isServer]]
}}




<!-- Note Section END -->
<dl class="command_description">
</dl>
 


[[Category:Arma 2: Operation Arrowhead: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
<dt></dt>
{{GameCategory|arma2|Scripting Commands}}
<dd class="notedate">Posted on 2014-12-21 - 14:55 (UTC)</dd>
{{GameCategory|arma3|Scripting Commands}}
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on December 21, 2014 - 14:55 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
<dd class="note">
<code>[[if]] ([[isDedicated]]) [[then]] {
<sqf>
if (isDedicated) then {
//run on dedicated server only
//run on dedicated server only
};
};


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


[[if]] ([[hasInterface]]) [[then]] {
if (hasInterface) then {
//run on all player clients incl. player host
//run on all player clients incl. player host
};
};


[[if]] (![[isDedicated]]) [[then]] {
if (!isDedicated) then {
//run on all player clients incl. player host and headless clients
//run on all player clients incl. player host and headless clients
};
};


[[if]] (![[isServer]]) [[then]] {
if (!isServer) then {
//run on all player clients incl. headless clients but not player host
//run on all player clients incl. headless clients but not player host
};
};


[[if]] (![[hasInterface]]) [[then]] {
if (!hasInterface) then {
//run on headless clients and dedicated server
//run on headless clients and dedicated server
};
};


[[if]] (![[hasInterface]] && ![[isDedicated]]) [[then]] {
if (!hasInterface && !isDedicated) then {
//run on headless clients only
//run on headless clients only
};</code>
};
</sqf>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

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 };