serverCommandAvailable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(servercommand will not work from anywhere)
mNo edit summary
(12 intermediate revisions by the same user not shown)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| 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
| 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:
<br><br>
* '''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
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 17: Line 32:
____________________________________________________________________________________________
____________________________________________________________________________________________
|x1 = <code>_can = [[serverCommandAvailable]] "#kick";</code>
|x1 = <code>_can = [[serverCommandAvailable]] "#kick";</code>
|x2 = Add button to the main map to lock server, which could only be activated by admin:
|x2 = <code>[[if]] ([[serverCommandAvailable]] "#logout") [[then]]  
<code>
{
[[if]] ([[serverCommandAvailable]] "#logout") [[then]] {
[[hint]] "You are a some sort of admin";
[[hint]] "You are an admin";
};</code>
};</code>
| [[serverCommand]], [[serverCommandExecutable]], [[Multiplayer Server Commands]] |= See also
| [[serverCommand]], [[serverCommandExecutable]], [[admin]], [[Multiplayer Server Commands]] |= See also


}}
}}

Revision as of 01:09, 20 April 2017

Hover & click on the images for description

Description

Description:
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:

  • Available to anyone

#login, #userlist, #beclient, #vote

  • Available to any admin (voted in / logged in) or server host

#kick, #debug

#lock, #unlock, #maxping, #maxdesync, #maxpacketloss

  • Available to any admin (voted in / logged in)

#logout, #restart, #mission, #missions, #reassign, #monitor, #init

  • Available to logged in admin

#shutdown, #restartserver, #exec, #beserver, #monitords, #logentities, #exportjipqueue

  • Available to logged in admin on certain game builds

#captureframe, #enabletest, #disabletest

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.

NOTE: When password variant of serverCommand is used on dedicated server, the table above does not apply as everything is available to it.
Groups:
Uncategorised

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:
serverCommandserverCommandExecutableadminMultiplayer 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

Notes

Bottom Section