Jump to content

SendNetworkString: Difference between revisions

m
Tweaked example slightly
(Added an example)
Tag: Source edit
m (Tweaked example slightly)
Line 20: Line 20:
== Examples ==
== Examples ==
<syntaxhighlight lang="c">
<syntaxhighlight lang="c">
Script "ReceiveStringOnServer" (int str) NET
{
    Print(s:"Received '", s:str, s:"' from a client");
}
Script "ClientScript" (void) CLIENTSIDE
Script "ClientScript" (void) CLIENTSIDE
{
{
     // Since the third argument (client) was not specified, the print will appear for all players
     // Since the third argument (client) was not specified, the print will appear for all players
     NamedSendNetworkString("ReceiveStringOnServer", "Hello Server");
     NamedSendNetworkString("ReceiveStringOnServer", "Hello Server");
}
Script "ReceiveStringOnServer" (int str) NET
{
    Print(s:"Received '", s:str, s:"' from a client");
}
}
</syntaxhighlight>
</syntaxhighlight>


[[category:ACS functions]]
[[category:ACS functions]]