remoteExec can also be used in SP (the same restrictions apply both to SP and MP). For more information about the usage, security features and advanced jip techniques check the remote execution dedicated section.

functionName: String - function or command name.
While any function can be used, only commands and functions defined in CfgRemoteExec will be executed.

targets (Optional): [default: 0 = everyone]

Number - the function will be executed only on client with the given owner ID. When 0, the function will be executed on each client including the one where remoteExec was called from. When 2, it will be executed only by server. When negative, it will be executed everywhere except for machines with the given client ID. Use -2 to target everyone except the server.

Side - the function will be executed only on clients where the player is on the specified side

Group - the function will be executed only on clients where the player is in the specified group. In order to execute the function where group is local pass owner of the group as param: _myGroup remoteExec ["deleteGroup", groupOwner _myGroup];

JIP (Optional): String or Boolean - If true, function generates a unique ID for the message and the message itself is added to the JIP queue and executed for every JIP. If a non-empty string is given, it is treated a custom ID of the message and the message itself is added to the JIP queue overriding any remoteExecCall message with the same ID. Otherwise, no ID is generated and no message is placed into the JIP queue. [default: false] (see also Example 7 on how to remove previously set function from JIP queue)

Note: JIP mostly makes sense for messages doing changes local to client (not directly synchronized over the network). Otherwise, after remoteExec is executed, depending on the contents of the global JIP queue there is a chance a new message could be added to it, unnecessary increasing the number of messages sent to any newly connected client.
E.g. calling "..remoteExec ["setFuel"..]" is fine, however, calling "..remoteExec ["publicVariable",..]" is not.

返回值:

Anything - Nil in case of error. String otherwise. If JIP is not requested this is an empty string, if JIP is requested, it is the JIP ID. See the topic Function for more information.

额外资讯

注意事项

While it is true that this function executes the desired scripted command/function by calling it, it does not mean remoteExecCall itself will be executed right away. Therefore, calling remoteExecCall is by no means a replacement for calling scripted commands/functions directly.
Example:remoteExecCall ["func1"]; call func2; // func2 can be executed sooner than func1call func1; call func2; // func2 will always execute after func1.

remoteExec and remoteExecCall are currently filtered by BattlEye's remoteexec.txt, the string passed to BattlEye is formatted the same way as the following example's output:
format ["%1 %2", functionName, str params]

The INCORRECT way to call reveal command on a certain object for every player:
[player, _desired_object] remoteExec ["reveal", 0];
In this case player object will be the object obtained on the computer where remoteExec is initiated. If it is dedicated server, player will be objNull, if it is client, player would be player object on this client. In any case this will not reveal _desired_object for all connected players.

The CORRECT way:
[_desired_object, {playerreveal _this}] remoteExec ["call", 0];
The _desired_object will be identical on every client, this is what we want, but player will refer to individual player on each client, so _desired_object will be revealed to all connected players.