ExecuteClientScript: Difference between revisions

From Zandronum Wiki
(Added page for ExecuteClientScript and NamedExecuteClientScript.)
 
(Use Zdoomwiki template)
Tag: Source edit
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:ACSWarning}}
{{Template:ACSWarning}}
int '''ExecuteClientScript''' (int ''script'', int ''client'' [, int ''arg0'' [, int ''arg1'' [, int ''arg2'' [, int ''arg3'']]]]) {{Devfeature|3.1|alpha}}
int '''ExecuteClientScript''' (int ''script'', int ''client'' [, int ''arg0'' [, int ''arg1'' [, int ''arg2'' [, int ''arg3'']]]])


int '''NamedExecuteClientScript''' (str ''script'', int ''client'' [, int ''arg0'' [, int ''arg1'' [, int ''arg2'' [, int ''arg3'']]]]) {{Devfeature|3.1|alpha}}
int '''NamedExecuteClientScript''' (str ''script'', int ''client'' [, int ''arg0'' [, int ''arg1'' [, int ''arg2'' [, int ''arg3'']]]])


== Usage ==
== Usage ==
Equivalent to {{Zdoomwiki|ACS_ExecuteAlways}}, except that it only executes the ''script'' with the given arguments for one ''client''. This is an efficient way of executing <tt>CLIENTSIDE</tt> 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.


Equivalent to [https://zdoom.org/wiki/ACS_ExecuteAlways ACS_ExecuteAlways], except that it only executes the ''script'' with the given arguments for one ''client''. This is an efficient way of executing <tt>CLIENTSIDE</tt> 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.
=== Parameters ===
* ''script'': The number or name of the script to excecute.
* ''client'': The client to execute the script on.
* ''arg0'' .. ''arg3'': The arguments to be passed to the script.


== Return Value ==
=== 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 <tt>CLIENTSIDE</tt> flag.
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 <tt>CLIENTSIDE</tt> flag.


[[category:ACS Functions]]
== Examples ==
{{noexamples}}
 
[[Category:ACS functions]]

Latest revision as of 18:52, 2 July 2022

This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

int ExecuteClientScript (int script, int client [, int arg0 [, int arg1 [, int arg2 [, int arg3]]]])

int NamedExecuteClientScript (str script, int client [, int arg0 [, int arg1 [, int arg2 [, int arg3]]]])

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.

Parameters

  • script: The number or name of the script to excecute.
  • client: The client to execute the script on.
  • arg0 .. arg3: The arguments to be passed to the script.

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.

Examples

This article lists no examples, please add one.