Kick Server function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.0.0

Kick player of specific id from the server.

Syntax

void kick(int id, string reason)

Required Arguments

  • id: id of the player who you want to kick.
  • reason: reason of the kick.

Example

addEventHandler("onPlayerCommand",function(pid,cmd,params)
{
	params = sscanf("ds",params);

	if(cmd == "kick" && typeof(params) == "array")
	{
		if(isPlayerConnected(params[0]))
		{
			kick(params[0],params[1]);
		}
		else
		{
			sendMessageToPlayer(pid,220,20,30,"Id: "..id.." is not connected with the server");
		}
	}
});

Related functions

Server

Shared