Player::kick

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Kicks a player from the server.

Syntax

player.kick(reason);

Parameters

  • reason: String (This message does not show up for the player being kicked)

Examples

Server-Side
mp.events.addCommand('kick', (player, target) => {
	let newTarget = mp.players.at(target);
	if(!target || isNaN(target)) return player.outputChatBox("Syntax: /kick [playerID]");
	if(newTarget === null) return player.outputChatBox("There is no player online with the ID given.")
	newTarget.outputChatBox("You have been kicked from the server.");
	newTarget.kick('Kicked.');
});

See Also