GetAccountPlayer: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
m (Добавление языков) |
||
Line 29: | Line 29: | ||
{{Account functions}} | {{Account functions}} | ||
[[en:getAccountPlayer]] | |||
[[ru:getAccountPlayer]] | [[ru:getAccountPlayer]] | ||
[[ar:getAccountPlayer]] | [[ar:getAccountPlayer]] | ||
[[pl:GetAccountPlayer]] | [[pl:GetAccountPlayer]] | ||
[[zh-cn:GetAccountPlayer]] | [[zh-cn:GetAccountPlayer]] |
Revision as of 13:02, 12 April 2021
This function returns the player element that is currently using a specified account, i.e. is logged into it. Only one player can use an account at a time.
Syntax
player getAccountPlayer ( account theAccount )
OOP Syntax Help! I don't understand this!
- Method: account:getPlayer(...)
- Variable: .player
Required Arguments
Returns
Returns a player 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 thePlayer = getAccountPlayer ( theAccount ) -- get the client attached to the account if ( getElementType ( thePlayer ) == "player" ) then -- see if it really is a player (rather than a console admin for example) return not isPedDead(thePlayer) -- if the player's health is greater than 0 end return false end
See Also
- addAccount
- copyAccountData
- getAccount
- getAccountData
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccounts
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountPassword
- getAccountByID
- getAccountID
- getAccountIP
- getAccountsByData
- getAccountsByIP
- setAccountName