serverCommand

From Bohemia Interactive Community
Revision as of 11:55, 16 October 2014 by Killzone Kid (talk | contribs) (see also)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Executes a server command on the server. In order to be able to execute admin command the user must be logged in as admin. Commands available for non-admin users are: #login, #vote and #userlist. Which command is available can be detected with serverCommandAvailable and whether or not it can be executed with serverCommandExecutable.

NOTE: This command must be executed from UI event handler (ctrlAddEventHandler, displayAddEventHandler), such as onButtonDown or other User_Interface_Event_Handlers.
Groups:
Uncategorised

Syntax

Syntax:
serverCommand command
Parameters:
command : String
Return Value:
Boolean - always true for some reason

Examples

Example 1:
serverCommand "#logout";
Example 2:
Create button on the main map which will show userlist to anyone who clicks on it: with uiNamespace do { ctrl = findDisplay 12 ctrlCreate ["RscButton", -1]; ctrl ctrlSetPosition [0,0,0.5,0.1]; ctrl ctrlSetText "USERLIST"; ctrl ctrlCommit 0; ctrl ctrlAddEventHandler [ "ButtonDown", {serverCommand "#userlist"} ]; };
Example 3:
serverCommand format ["#kick %1",_name];

Additional Information

See also:
serverCommandAvailableserverCommandExecutable

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