Server And Client Communication

The functions commandToClient and commandtoServer sends a command to the client or the server. commandToClient takes 2+ parameters. The first one being the id of the client, the second is the tag of the command the client should execute. All following parameters is the arguments passed to the command.

commandToServer is similar, except it doesn't need an ID so it takes 1+ parameters. To define a function which can be called by a network command, it has to follow a special naming convention. clientCmdtheCommandName(args);
Example:

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License