This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
functions:sendstring [2016/10/18 23:15] – korshun | functions:sendstring [2017/05/12 15:16] (current) – removed korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 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> | ||
- | <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 '' | ||
- | |||
- | |||
- | |||