OnPlayerLogin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:
==Source==
==Source==
The [[event system#Event source|source]] of this event is the player [[element]] that just logged in.
The [[event system#Event source|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==  
==Example==  

Revision as of 15:28, 6 August 2010

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:

local root = getRootElement()

addEventHandler("onPlayerLogin", root,
  function()
    outputChatBox(getPlayerName(source).." has logged in!", root)
  end
)

See Also

Player events


Event functions