serverCommand: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{Feature[ _]arma3" to "{{Feature|arma3") |
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]3(\|.*)\]\]" to "{{GameCategory|arma3|Scripting Commands}}") |
||
Line 59: | Line 59: | ||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]] | ||
{{GameCategory|arma3|Scripting Commands}} | |||
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]] |
Revision as of 05:09, 9 January 2021
Description
- Description:
- Executes the given server command.
- Available commands for execution can be found with serverCommandAvailable.
- Commands that can be executed can be found with serverCommandExecutable.
- Groups:
- Multiplayer
Syntax
- Syntax:
- serverCommand command
- Parameters:
- command : String
- Return Value:
- Boolean - always true for some reason (since Arma 3 v1.39 also false if a non valid command is used ("#blah"))
Alternative Syntax
- Syntax:
- password serverCommand command Template:since Template:ServerExec
- Parameters:
- password : String - password defined in server.cfg with serverCommandPassword param
- command : String - server command
- Return Value:
- Boolean - true if password is correct
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];
- Example 4:
_passwordWasOK = "MyServerCommandPassword" serverCommand "#lock";
Additional Information
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