onPlayerLogin | Multi Theft Auto: Wiki Skip to content

onPlayerLogin

Client-side
Server-side
Shared

This event is triggered when a player logs into their account in-game.

Parameters

account thePreviousAccount, account theCurrentAccount
  • thePreviousAccount: The account the player was logged into before.
  • theCurrentAccount: The account the player logged into just now.

Source

element: The source of this event is the player element that just logged in.

Canceling

If this event is canceled the player will not be logged in.

Code Examples

server

This example just outputs to the player console that a player in one account logged into an another account:

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

See Also