ExecuteClientScript

From Zandronum Wiki
Jump to navigation Jump to search
Zandronum SkulltagOverlay.png Warning: This feature is Zandronum specific and may not supported by ZDoom and its other child ports!
Documentation may not be accurate, see ACS Functions.

int ExecuteClientScript (int script, int client [, int arg0 [, int arg1 [, int arg2 [, int arg3]]]]) (development version 3.1-alpha and above only)

int NamedExecuteClientScript (str script, int client [, int arg0 [, int arg1 [, int arg2 [, int arg3]]]]) (development version 3.1-alpha and above only)

Usage

Equivalent to ACS_ExecuteAlways, except that it only executes the script with the given arguments for one client. This is an efficient way of executing CLIENTSIDE scripts that should only need to be run by one client, or at least not by everyone, thereby reducing network traffic. NamedExecuteClientScript works the same way but for named scripts. If run offline, the script will be executed on the local machine like normal.

Return Value

Returns 1 if the script could be executed successfully, or 0 if wasn't. The function might explicitly fail because either the client tried running this command in a network game or because the script doesn't have the CLIENTSIDE flag.