Loading function...

Please make sure JavaScript is enabled. Otherwise you will be unable to see the function documentation.

Returns an iterator function that will return each player one at a time. Usually you do not want to use All.

If All is true, even players that are not fully connected will be returned.

This is a server function.

Arguments

Results

Example

Print connected players using a command.

SetCommand("list_players", function()
	for player in AllPlayers() do
		print(GetPlayerName(player).." (id = "..player))
	end
end)

Return a player's ip address.

Arguments

Results

Return a player's name.

This function is a DSL5 function, ignore the DSL1 tag.

This is a server function, see the client version here: GetPlayerName.

Arguments

Results

Return the server's refresh rate in hertz.

Arguments

None.

Results

Return if a player is valid or not. If Lenient is true, the player does not have to be fully connected to be considered valid.

Arguments

Results

Kick a player. Players can be kicked at any time, or during a PlayerConnecting event to keep the player from being connected.

Arguments

Results

None.

Send Lua data over the network. This function should usually only be used by server scripts.

You can add network events using the RegisterNetworkEventHandler function.

This is a server function, see the client version here: SendNetworkEvent.

Data is sent to a connected Player or sent to all connected players by using -1.

The same restrictions apply here as with PackTable.

Arguments

Results

None.