RU/GetAccount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Redirected page to RU/getAccount)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
__NOTOC__
#REDIRECT [[RU/getAccount]]
{{Server function}}
This function returns an account for a specific user.
==Syntax==
<syntaxhighlight lang="lua">
account getAccount ( string username, [ string password ] )
</syntaxhighlight>
 
===Required Arguments===
*'''username:''' The username of the account you want to retrieve
 
===Optional Arguments===
{{OptionalArg}}
*'''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===
An ''account'' value or ''false'' if an account matching the username specified (and password, if specified) could not be found.
 
==Example==
<syntaxhighlight lang="lua">addEventHandler("onPlayerJoin",root,function()
    if getAccount(getPlayerName(source)) then
        outputChatBox("Please Login!",source)
    else
        outputChatBox("Please Register!",source)
    end
end)
</syntaxhighlight>
 
==See Also==
{{Account functions}}
 
[[es:getAccount]]
[[pl:GetAccount]]
[[en:GetAccount]]

Latest revision as of 13:49, 11 September 2014

Redirect to: