serverCommandAvailable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game version" to "|Game version=")
(added note about rcon permissions state for serverCommandAvailable sqf command)
 
(46 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.05


|1.05|Game version=
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Returns [[true]] if given [[serverCommand]] is available on current machine, [[false]] if not. Here is the general table of availability of Arma 3 server commands:
|game3= tkoh
<br><br>
|version3= 1.00
* '''Available to anyone'''
<blockquote><tt>#login</tt>, <tt>#userlist</tt>, <tt> #beclient</tt>, <tt> #vote</tt></blockquote>
* '''Available to any [[admin]] (voted in / logged in) or [[isServer|server]] host'''
<blockquote><tt>#kick</tt>, <tt>#debug</tt></blockquote>
* '''Available to logged in [[admin]] or [[isServer|server]] host'''
<blockquote><tt>#lock</tt>, <tt>#unlock</tt>, <tt>#maxping</tt>, <tt>#maxdesync</tt>, <tt>#maxpacketloss</tt></blockquote>
* '''Available to any [[admin]] (voted in / logged in)'''
<blockquote><tt>#logout</tt>, <tt>#restart</tt>, <tt>#mission</tt>, <tt>#missions</tt>, <tt>#reassign</tt>, <tt>#monitor</tt>, <tt>#init</tt></blockquote>
* '''Available to logged in [[admin]]'''
<blockquote><tt>#shutdown</tt>, <tt>#restartserver</tt>, <tt>#exec</tt>, <tt>#beserver</tt>, <tt>#monitords</tt>, <tt>#logentities</tt>, <tt>#exportjipqueue</tt></blockquote>
* '''Available to logged in [[admin]] on certain game builds'''
<blockquote><tt>#captureframe</tt>, <tt>#enabletest</tt>, <tt>#disabletest</tt></blockquote>
To check if server command could be executed in current environment use [[serverCommandExecutable]]. For more information on what each server command does, see [[Multiplayer Server Commands]].<br><br>
'''NOTE''': When password variant of [[serverCommand]] is used on dedicated server, the table above does not apply as everything is available to it. |DESCRIPTION=
____________________________________________________________________________________________


| '''serverCommandAvailable''' command |SYNTAX=
|game4= arma3
|version4= 0.50


|p1=  command: [[String]] |PARAMETER1=
|gr1= Multiplayer


| [[Boolean]] |RETURNVALUE=
|descr= Returns [[true]] if given [[serverCommand]] is available on current machine, [[false]] if not.
____________________________________________________________________________________________
|x1 = <code>_can = [[serverCommandAvailable]] "#kick";</code>
|x2 = <code>[[if]] ([[serverCommandAvailable]] "#logout") [[then]]
{
[[hint]] "You are a some sort of admin";
};</code>
| [[serverCommand]], [[serverCommandExecutable]], [[admin]], [[Multiplayer Server Commands]] |SEEALSO=


{{Feature|informative|
Execution via [[BattlEye#RCon|RCon]] is basically being '''logged-in''' as [[admin]] in terms of permissions.
}}
}}


<h3 style="display:none">Notes</h3>
{{{!}} class="wikitable align-center"
<dl class="command_description">
! rowspan="2" {{!}} {{arma3}} [[Multiplayer Server Commands]]
<!-- Note Section BEGIN -->
! colspan="4" {{!}} Available to
<!-- Note Section END -->
{{!}}-
</dl>
! Client
! Voted [[admin|Admin]]
! Logged [[admin|Admin]]
! [[isServer|Server Host]]
{{!}}-
{{!}} {{hl|#login}}, {{hl|#userlist}}, {{hl|#beclient}}, {{hl|#vote}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}}-
{{!}} {{hl|#kick}}, {{hl|#debug}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}}-
{{!}} {{hl|#lock}}, {{hl|#unlock}}, {{hl|#maxping}}, {{hl|#maxdesync}}, {{hl|#maxpacketloss}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}}-
{{!}} {{hl|#logout}}, {{hl|#restart}}, {{hl|#mission}}, {{hl|#missions}}, {{hl|#reassign}}, {{hl|#monitor}}, {{hl|#init}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|unchecked}}
{{!}}-
{{!}} {{hl|#shutdown}}, {{hl|#restartserver}}, {{hl|#restartserveraftermission}}, {{hl|#shutdownaftermission}}, {{hl|#dctimeout}}, {{hl|#exec}}, {{hl|#monitords}}, {{hl|#beserver}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|unchecked}}
{{!}}-
{{!}} {{hl|#logentities}}, {{hl|#exportjipqueue}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}}-
{{!}} Profiling type builds only: {{hl|#captureframe}}, {{hl|#captureslowframe}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
<!--
{{!}}-
{{!}} Disabled: {{hl|#admin}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
-->
{{!}}}
 
To check if a [[Multiplayer Server Commands|server command]] can be executed in the current environment, use [[serverCommandExecutable]].
 
{{Feature|informative|The table above does not apply to the command's password variant on a dedicated server as everything is available to it.}}
 
|s1= [[serverCommandAvailable]] command
 
|p1= command: [[String]]
 
|r1= [[Boolean]]


<h3 style="display:none">Bottom Section</h3>
|x1= <sqf>_can = serverCommandAvailable "#kick";</sqf>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
|x2= <sqf>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
if (serverCommandAvailable "#logout") then
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
{
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
hint "You are a some sort of admin";
};
</sqf>
 
|seealso= [[serverCommand]] [[serverCommandExecutable]] [[admin]] [[isServer]] [[Multiplayer Server Commands]]
}}

Latest revision as of 15:40, 29 October 2024

Hover & click on the images for description

Description

Description:
Returns true if given serverCommand is available on current machine, false if not.
Execution via RCon is basically being logged-in as admin in terms of permissions.
Arma 3 Multiplayer Server Commands Available to
Client Voted Admin Logged Admin Server Host
#login, #userlist, #beclient, #vote Checked Checked Checked Checked
#kick, #debug Unchecked Checked Checked Checked
#lock, #unlock, #maxping, #maxdesync, #maxpacketloss Unchecked Unchecked Checked Checked
#logout, #restart, #mission, #missions, #reassign, #monitor, #init Unchecked Checked Checked Unchecked
#shutdown, #restartserver, #restartserveraftermission, #shutdownaftermission, #dctimeout, #exec, #monitords, #beserver Unchecked Unchecked Checked Unchecked
#logentities, #exportjipqueue Unchecked Unchecked Checked Checked
Profiling type builds only: #captureframe, #captureslowframe Unchecked Unchecked Checked Checked

To check if a server command can be executed in the current environment, use serverCommandExecutable.

The table above does not apply to the command's password variant on a dedicated server as everything is available to it.
Groups:
Multiplayer

Syntax

Syntax:
serverCommandAvailable command
Parameters:
command: String
Return Value:
Boolean

Examples

Example 1:
_can = serverCommandAvailable "#kick";
Example 2:
if (serverCommandAvailable "#logout") then { hint "You are a some sort of admin"; };

Additional Information

See also:
serverCommand serverCommandExecutable admin isServer Multiplayer Server Commands

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