Jump to content

problem


Wei

Recommended Posts

function setPlayerGangLeader( thePlayer, command, sPlayer ) 
    local dPlayer = getPlayerFromName( sPlayer ) 
    local acc = getPlayerAccount( thePlayer ) 
    local dAcc = getPlayerAccount( dPlayer ) 
    if getAccountData( acc, "GroupRank" ) == "gangLeader" then 
        if getAccountData( dAcc, "Group" ) == getAccountData( acc, "Group" ) then 
        setAccountData( dAcc, "GroupRank", "gangLeader" ) 
    else 
        outputChatBox("error") 
        end 
    end 
end 
addCommandHandler( "setGangLeader", setPlayerGangLeader ) 

ERROR

[2012-05-20 13:40:02] WARNING: group\server.lua:79: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got boolean] 
[2012-05-20 13:40:02] WARNING: group\server.lua:81: Bad argument @ 'getAccountData' [Expected account at argument 1, got boolean] 
  

Link to comment

Maybe

function setPlayerGangLeader( thePlayer, command, sPlayer, dPlayer ) 
    local dPlayer = getPlayerFromName( sPlayer ) 
    local acc = getPlayerAccount( thePlayer ) 
    local dAcc = getPlayerAccount( dPlayer ) 
    if getAccountData( acc, "GroupRank" ) == "gangLeader" then 
        if getAccountData( dAcc, "Group" ) == getAccountData( acc, "Group" ) then 
        setAccountData( dAcc, "GroupRank", "gangLeader" ) 
    else 
        outputChatBox("error") 
        end 
    end 
end 
addCommandHandler( "setGangLeader", setPlayerGangLeader ) 

Edited by Guest
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...