GetAccount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(OOP syntax added)
m (→‎Syntax: OOP)
Line 6: Line 6:
account getAccount ( string username, [ string password ] )
account getAccount ( string username, [ string password ] )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||Account.create||}}
{{OOP|This function is also a static function underneath the Account class.|[[account]]:create||}}
===Required Arguments===
===Required Arguments===
*'''username:''' The username of the account you want to retrieve
*'''username:''' The username of the account you want to retrieve

Revision as of 16:00, 22 August 2014

This function returns an account for a specific user.

Syntax

account getAccount ( string username, [ string password ] )

OOP Syntax Help! I don't understand this!

Note: This function is also a static function underneath the Account class.
Method: account:create(...)


Required Arguments

  • username: The username of the account you want to retrieve

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • password: The password for the account. If this argument is not specified, you can get the account whatever password it is, otherwise the password must match the account's.

Returns

Returns an account or false if an account matching the username specified (and password, if specified) could not be found.

Example

addEventHandler("onPlayerJoin",root,function()
    if getAccount(getPlayerName(source)) then
        outputChatBox("Please Login!",source)
    else
        outputChatBox("Please Register!",source)
    end
end)

See Also