OnPlayerJoin

From Onset Developer Wiki
Revision as of 19:11, 22 March 2019 by BlueMountains (talk | contribs)
OnPlayerJoin

Type: Event
Context: Server
Introduced: v1.0

Description

Called when a player is fully connected to the server. The game has started on the client and the player is going to spawn after this event was executed.

Syntax

OnPlayerJoin(player)

Parameters

  • player
    The player who has joined.

Example

function OnPlayerJoin(player)
    -- Set where the player is going to spawn.
	SetPlayerSpawnLocation(player, 125773.000000, 80246.000000, 1645.000000, 90.0)

	AddPlayerChatAll('<span color="#eeeeeeaa">'..GetPlayerName(player)..' from '..GetPlayerLocale(player)..' joined the server</>')
	AddPlayerChatAll('<span color="#eeeeeeaa">There are '..GetPlayerCount()..' players on the server</>')
end
AddEvent("OnPlayerJoin", OnPlayerJoin)

See also

Player

Vehicle

Game

Package

NPC

Object

Pickup

Text3D

Door