Jump to content

getPlayerAccount


Drakath

Recommended Posts

Posted
local accName = getAccountName ( getPlayerAccount ( p ) ) 

Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]

attempt to concatenate local 'accName' (a boolean value)

How is it possible that getPlayerAccount returns false and how can I fix it?

Posted
Lol.

P isn't defined.

I didn't defined it but this should work.

  
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
  

And where did you define 'thePlayer'? thePlayer is not the same as localPlayer in client side... You will ALWAYS need to define the player element ( except when using functions that return source as a player element )

Posted
I did define p.
if isGuestAccount ( getPlayerAccount  ( p ) ) then return end 
    local accName = getAccountName ( getPlayerAccount ( p ) ) 

You can try this and please make sure that it's not an guest account.

Posted

Now I get:

WARNING: Bad argument @ 'isGuestAccount' [Expected account at argument 1, got boolean]

WARNING: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]

ERROR: attempt to concatenate local 'accName' (a boolean value)

Posted

Ugh, no.

local account = ( getPlayerAccount( p ) and not isGuestAccount( getPlayerAccount( p ) ) ) and getPlayerAccount( p ) or false 
local account_name = account and getAccountName( account ) or "Unknown" 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...