serverCommand: Difference between revisions
Jump to navigation
Jump to search
m (fixed first syntax) |
Lou Montana (talk | contribs) m (Text replacement - " \|(x[0-9]|p[0-9]{1,2}|descr|game[0-9]|version[0-9]|s[0-9]|exec|r[0-9]|arg|eff|branch|serverExec|gr[0-9]|mp|pr|seealso) +=" to " |$1=") |
||
Line 50: | Line 50: | ||
};</code> | };</code> | ||
|x3 = <code>[[serverCommand]] [[format]] ["#kick %1",_name];</code> | |x3= <code>[[serverCommand]] [[format]] ["#kick %1",_name];</code> | ||
|x4 = <code>_passwordWasOK = "MyServerCommandPassword" [[serverCommand]] "#lock";</code> | |x4= <code>_passwordWasOK = "MyServerCommandPassword" [[serverCommand]] "#lock";</code> | ||
|seealso= [[serverCommandAvailable]], [[serverCommandExecutable]], [[admin]], [[isUIContext]] | |seealso= [[serverCommandAvailable]], [[serverCommandExecutable]], [[admin]], [[isUIContext]] | ||
}} | }} |
Revision as of 23:28, 10 June 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.
- Problems:
- Groups:
- Multiplayer
Syntax
- Syntax:
- serverCommand command
- Parameters:
- command : String
- Return Value:
- Return value needed
Alternative Syntax
- Syntax:
- password serverCommand command 1.40 SEServer
- 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