OnPlayerJoin: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
==Parameters== | ==Parameters== | ||
The '''source''' of this event is the player who joined. | *The '''source''' of this event is the [[player]] who joined. | ||
==Example== | ==Example== |
Revision as of 18:09, 22 April 2007
This event is triggered when a player joins the server.
Syntax
void onPlayerJoin ( )
Parameters
- The source of this event is the player who joined.
Example
This example gets the joined client's name and sends him a welcome message including his name.
-- we register greetPlayer as a handler for the event addEventHandler ( "onPlayerJoin", getRootElement(), "greetPlayer" ) function greetPlayer ( ) -- we store the player's name local joinedPlayerName = getClientName ( source ) -- and send him a greeting outputChatBox ( "Welcome " ..joinedPlayerName.. " to the server!" , source, 255, 255, 255 ) end
See also
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled