This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
functions:sendstring [2016/10/18 20:47] – created korshun | functions:sendstring [2016/10/19 00:24] – korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Sending strings from server to client ====== | ====== Sending strings from server to client ====== | ||
+ | |||
+ | ===== Sending strings ===== | ||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | These functions will launch the specified clientside script and send the string to it. For example: | ||
+ | |||
+ | < | ||
+ | ACS_SendString(123, | ||
+ | ACS_NamedSendString(" | ||
+ | </ | ||
+ | |||
+ | Maximum string size is unlimited, but the larger it is, the more the server will lag while sending it. | ||
+ | |||
+ | <note warning> | ||
+ | |||
+ | Test your mods on a server (this is recommended for many other reasons too).</ | ||
+ | <note important> | ||
+ | <note important> | ||
+ | ===== Receiving strings ===== | ||
+ | |||
+ | To receive a string, the receiving script must be like this: | ||
+ | |||
+ | < | ||
+ | script 123 (int a, int b, int c, int d) CLIENTSIDE | ||
+ | { | ||
+ | if (!ReceiveString(a, | ||
+ | terminate; | ||
+ | |||
+ | // Insert your code here. The string can now be retrieved using GetReceivedString(). | ||
+ | Log(s:" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Use '' | ||
+ | |||