serverCommandAvailable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(servercommand will not work from anywhere)
m (Some wiki formatting)
 
(55 intermediate revisions by 4 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 the [[serverCommand]] can be performed on the machine, [[false]] if not. serverCommand can be executed only from [[User Interface Event Handlers]], so calling this command elsewhere may return true even if serverCommand would have no effect. |= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


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


|p1= command: [[String]] |= Parameter 1
|gr1= Multiplayer


| [[Boolean]] |= Return value
|descr= Returns [[true]] if given [[serverCommand]] is available on current machine, [[false]] if not.
____________________________________________________________________________________________
|x1 = <code>_can = [[serverCommandAvailable]] "#kick";</code>
|x2 = Add button to the main map to lock server, which could only be activated by admin:
<code>
[[if]] ([[serverCommandAvailable]] "#logout") [[then]] {
[[hint]] "You are an admin";
};</code>
| [[serverCommand]], [[serverCommandExecutable]], [[Multiplayer Server Commands]] |= See also


}}
{{{!}} class="wikitable align-center"
! rowspan="2" {{!}} {{arma3}} [[Multiplayer Server Commands]]
! colspan="4" {{!}} Available to
{{!}}-
! 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|#exec}}, {{hl|#beserver}}, {{hl|#monitords}}, {{hl|#logentities}}, {{hl|#exportjipqueue}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{Icon|unchecked}}
{{!}}-
{{!}} Specific builds only: {{hl|#captureframe}}, {{hl|#enabletest}}, {{hl|#disabletest}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}} {{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]]
 
|x1= <sqf>_can = serverCommandAvailable "#kick";</sqf>


<h3 style="display:none">Notes</h3>
|x2= <sqf>if (serverCommandAvailable "#logout") then
<dl class="command_description">
{
<!-- Note Section BEGIN -->
hint "You are a some sort of admin";
<!-- Note Section END -->
};</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[serverCommand]] [[serverCommandExecutable]] [[admin]] [[isServer]] [[Multiplayer Server Commands]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:07, 29 December 2022

Hover & click on the images for description

Description

Description:
Returns true if given serverCommand is available on current machine, false if not.
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, #exec, #beserver, #monitords, #logentities, #exportjipqueue Unchecked Unchecked Checked Unchecked
Specific builds only: #captureframe, #enabletest, #disabletest Unchecked Unchecked Checked Unchecked

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