IsPlayerConnected Server function

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

This function was added in version: 0.0.0

Returns true if the player is connected to the server and false if he's not.

Syntax

bool isPlayerConnected(int id)

Required Arguments

  • id: id of the player who you want to check.

Returns

  • true if the player is connected, or false if not.

Example

function sendMessageToOnlinePlayers(r,g,b,msg)
{
	for (i = 0; i < getMaxSlots(); i++)
	{
		if(isPlayerConnected(i))
		{
			sendMessageToPlayer(id, r, g, b, msg);
		};
	};
};

Related functions

Server

Shared