OnPlayerLogin: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
This example just outputs to the player console that a player in one account logged into an another account: | This example just outputs to the player console that a player in one account logged into an another account: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- root = getElementRoot() | |||
addEventHandler("onPlayerLogin",root, | |||
addEventHandler("onPlayerLogin", root, | |||
function() | function() | ||
outputChatBox(getPlayerName(source).." has logged in!", root) | outputChatBox(getPlayerName(source).." has logged in!", root) |
Revision as of 00:26, 9 November 2012
This event is triggered when a player logs into their account in-game.
Parameters
account thePreviousAccount, account theCurrentAccount, bool autoLogin
- thePreviousAccount: The account the player was logged into before
- theCurrentAccount: The account the player logged into just now
- autoLogin: Whether this login was a result of an autologin
Source
The source of this event is the player element that just logged in.
Cancel effect
If this event is canceled the player will not be logged in.
Example
This example just outputs to the player console that a player in one account logged into an another account:
-- root = getElementRoot() addEventHandler("onPlayerLogin",root, function() outputChatBox(getPlayerName(source).." has logged in!", root) end )
See Also
Player events
- onPlayerACInfo
- onPlayerBan
- onPlayerChangeNick
- onPlayerChat
- onPlayerClick
- onPlayerCommand
- onPlayerConnect
- onPlayerContact
- onPlayerDamage
- onPlayerJoin
- onPlayerLogin
- onPlayerLogout
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerModInfo
- onPlayerMute
- onPlayerNetworkStatus
- onPlayerPickupHit
- onPlayerPickupLeave
- onPlayerPickupUse
- onPlayerPrivateMessage
- onPlayerQuit
- onPlayerScreenShot
- onPlayerSpawn
- onPlayerStealthKill
- onPlayerTarget
- onPlayerUnmute
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerVoiceStart
- onPlayerVoiceStop
- onPlayerWasted
- onPlayerWeaponFire
- onPlayerWeaponSwitch
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled