Player::callUnreliable

From RAGE Multiplayer Wiki

Server-Side
Function

 JavaScript



This function triggers a client-side event for the selected player unreliably, which means it will be affected by potential packet loss, but it will be triggered way more faster, useful for when you need frequent triggers.

JavaScript Syntax

Syntax

player.callUnreliable('eventName', [...args]);

Required Arguments

  • *eventName: String
  • args: Any

Example

Server-Side
let player = mp.player.at(1337); //Get player by ID
if (player) {
  player.callUnreliable('syncUnreliableData', [123]); // example
}


Client-Side
// may not always be called because of possible packetloss
mp.events.add('syncUnreliableData', (data) => {
  mp.gui.chat.push(`we got data: ${data}`);
});


See Also