GetAccountClient: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
m (Changed "DeprecatedWithAlt" template to "Deprecated")
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Incomplete]]
__NOTOC__
[[Category:Need Syntax]]
{{Server function}}
 
{{Deprecated|getAccountPlayer|}}
__NOTOC__  
This function is for blahblah.. not defined yet


This function returns the client that is currently using a specified account, i.e. is logged into it. Only one client can use an account at a time.
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
INSERT SYNTAX HERE             
client getAccountClient ( account theAccount )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''theAccount:''' The account you wish to get the client of.
 
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns a [[client]] element if the account is currently in use, ''false'' otherwise.


==Example==  
==Example==  
This example does...
This example checks if the user attached to an account is a player, and if so if they're alive.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function isAccountUserAlive ( theAccount )
blabhalbalhb --abababa
    local theClient = getAccountClient ( theAccount )      -- get the client attached to the account
--This line does this...
    if ( getElementType ( theClient ) == "player" ) then    -- see if it's a player (rather than an admin for example)
mooo
        if ( not isPlayerDead ( theClient ) ) then          -- if the player's health is greater than 0
            return true
        end
    end
    return false
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{FunctionArea_Functions}}
{{Account_functions}}

Latest revision as of 16:21, 13 February 2015

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use getAccountPlayer instead.


This function returns the client that is currently using a specified account, i.e. is logged into it. Only one client can use an account at a time.

Syntax

client getAccountClient ( account theAccount )

Required Arguments

  • theAccount: The account you wish to get the client of.

Returns

Returns a client element if the account is currently in use, false otherwise.

Example

This example checks if the user attached to an account is a player, and if so if they're alive.

function isAccountUserAlive ( theAccount )
    local theClient = getAccountClient ( theAccount )       -- get the client attached to the account
    if ( getElementType ( theClient ) == "player" ) then    -- see if it's a player (rather than an admin for example)
        if ( not isPlayerDead ( theClient ) ) then          -- if the player's health is greater than 0 
            return true
        end
    end
    return false
end

See Also