ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:sendstring

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
functions:sendstring [2016/10/18 20:53] korshunfunctions:sendstring [2017/05/12 15:16] (current) – removed korshun
Line 1: Line 1:
-====== Sending strings from server to client ====== 
- 
-===== Sending strings ===== 
-''ACS_SendString(int scriptnum, str s)'' 
-''ACS_NamedSendString(str scriptname, str s)'' 
- 
-These functions will launch the specified clientside script and send the string to it. For example: 
- 
-<code> 
-ACS_SendString(123, "Hello there"); 
-ACS_NamedSendString("myscript", "A test string"); 
-</code> 
- 
-===== Receiving strings ===== 
- 
-To receive a string, the receiving script must be like this: 
- 
-<code> 
-script 123 (int a, int b, int c, int d) CLIENTSIDE 
-{ 
-        // Do nothing if the string hasn't been fully received. 
- if (!ReceiveString(a, b, c, d)) 
- terminate; 
-  
-        // The string has been fully received. It can now be retrieved using GetReceivedString(). 
- Log(s:"Received string: ", s:GetReceivedString()); 
-} 
-</code> 
- 
-Use ''GetReceivedString()'' to retrieve the string that has just been received. 
- 
- 
- 
  
functions/sendstring.1476813238.txt.gz · Last modified: 2016/10/18 20:53 by korshun