Author Topic: What is commandToServer & commandToClient used for?  (Read 935 times)

Is there a huge difference between the two?

Also, is there a difference between these?

Code: [Select]
commandToClient(%client, 'centerPrint', "hey", 3);
Code: [Select]
%client.centerPrint("hey", 3);

commandToServer sends a command to the server. commandToClient sends a command to a client. Major difference in function.

commandToClient is received at the clientCmd and which tells them to do the command.

commandToClient(%client,'CommandName',"args","here");
Sends the data through network packets towards %client and calls clientCmdCommandName with "args" and "here" as the args,  when the client receives it.
commandToServer('CommandName',"args","here");
Sends the data through network packets towards the server and calls clientCmdCommandName with %client (the client the command came from) and "args" and "here" as the args, when the server receives it.

EDIT: See here if you want more info https://docs.google.com/document/d/1tXmE2ZlJumfQDZAeN74H8fsu-OYwkT8FzQYPGhbWXzA/edit?hl=en&pli=1