From RAGE Multiplayer Wiki
Jump to navigation Jump to search

FROM SERVER: This function calls a client-side event for the selected player. FROM CLIENT: For Peer 2 Peer connections. The current client can call an event on another client's scriptside and that other client can handle that event.

Syntax eventName [, Array args]);

Required Arguments

  • eventName: The event name that will be called
  • args: Any arguments, what should be sent to client. Supports entities, strings, numbers and booleans. (Objects and Arrays should be packed to JSON format.) Arguments has to be packed in an array.


This example will call the client-side event 'disablePlayerRegeneration' for the player with the ID 1337.

let disableRegeneration = (currentHealth) => { //currentHealth - value, what we send from server.; //Disable regeneration`Regeneration disabled. Current health: ${currentHealth}`); //Output text to default chatbox
};'disablePlayerRegeneration', disableRegeneration);

let player =; //Get player by ID
if (player) {
	let playerHealth =;`disablePlayerRegeneration`, [playerHealth]);

See Also