Jump to content

Expected account, got string


Recommended Posts

I'm working on one of my system and I want to be able to get account data without player being online thus having a command like /getaccpos [account name]. The problem is the account name is a string, how do I convert a string into an account ?

Link to comment

getAccount will return the account element, which is what you need to use in getAccountData - not a string.

For example you could do this;

function exampleCommand_Handler(thePlayer, theCMD, theTarget) 
    local theData = getAccountData(getAccount(theTarget), "DataKey"); 
end 
addCommandHandler("GetAccPos", exampleCommand_Handler, false, false); 

Usage would be for example; /getaccposs account1

Link to comment

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...