PlayerQuit

From RAGE Multiplayer Wiki
Revision as of 11:26, 26 October 2018 by Rootcause (talk | contribs) (Replaced HTML with template)

This event is triggered when a player quits the server.

Parameters

  • player - player, which quit from the server
  • exitType - exit types:
    • disconnect
    • timeout
    • kicked
  • reason - kick reason

Example

This example outputs chat message, when player quits or kicked from the server.

Server-Side
function playerQuitHandler(player, exitType, reason) {
  let str = player.name;

  if (exitType != "kicked") {
    str += " quit.";
  } else {
    str = ` kicked. Reason: ${reason}.`;
  }

  console.log(str);
}

mp.events.add("playerQuit", playerQuitHandler);

See also

Checkpoint

Colshape

Entity

Player

Streaming

Vehicle

Waypoint