Jump to content

getPlayerAccount bad argument


-misterX-

Recommended Posts

the console reports bad argument on getPlayerAccount, expected account at argument 1 got nil

function arrestNumber ( source ) 
local playerAccount = getPlayerAccount(source) 
local arrest = getAccountData(playeraccount, "arrest") 
if not arrest then 
outputChatBox("you dont have any arrest",source) 
else 
outputChatBox("arrest: "..arrest,source) 
end 
end 
addCommandHandler ( "arrest", arrestNumber ) 

Link to comment

If I'm right...

function arrestNumber(player) 
    local playerAccount = getPlayerAccount(player) 
    local arrest = getAccountData(playerAccount, "arrest") 
    if not arrest then 
        outputChatBox("you dont have any arrest", player) 
    else 
        outputChatBox("arrest: "..arrest, player) 
    end 
end 
addCommandHandler("arrest", arrestNumber) 

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