Fandom

武装突袭 Wiki

ServerCommand

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

  This scripting command must be executed on the server to work properly in multiplayer

点击图片可看到更多讯息

开始使用于

游戏:
Arma 2
版本:
1.05

描述

描述:
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.

As of Arma 3 v1.39 serverCommand can be used on dedicated server and headless clients. This requires a password, both set in server.cfg and passed to the command itself.

基本句法

句法:
serverCommand command
参数:
command : String
返回值:
Boolean - always true for some reason (since A3 v1.39 also false if a non valid command is used ("#blah"))

替代句法

句法:
password serverCommand command      (since Arma 3 v1.39)
参数:
password : String - password defined in server.cfg with serverCommandPassword param

command : String
返回值:
Boolean - true if password is correct

范例

范例1:
serverCommand "#logout";

范例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"} ]; };

范例3:
serverCommand format ["#kick %1",_name];

额外资讯

多人游戏:
-
也可以看看:

serverCommandAvailableserverCommandExecutable

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Bottom Section

更多维基

随机维基