Subscribes to a client -> server RPC with the specified listener.
Example
alt.onRpc("testRpc",(player,...args)=>{ alt.log(`${player.name} called testRpc`, args); // throw new Error("I am an error! Notice me!"); return[1,2,[10,13,19],false,"hey there"]; });
Remarks
The return value of the listener function determines the response clients will receive. When returning multiple values, use an array. Returning an Error object will cause the promise on the client to throw an exception which has to be caught.
Subscribes to a client -> server RPC with the specified listener.
Example
Remarks
The return value of the listener function determines the response clients will receive. When returning multiple values, use an array. Returning an Error object will cause the promise on the client to throw an exception which has to be caught.