Jump to content

scoreboard


-misterX-

Recommended Posts

what's wrong?

the console says bad agrument on getplayeraccount and getaccount data

exports [ "scoreboard" ]:addScoreboardColumn ( "group", 3 )  
function updatePlayersMoney ( ) 
local account = getPlayerAccount(player) 
for index, player in ipairs ( getElementsByType "player" ) do 
local group = getAccountData(account, "group") 
end  
end  
setTimer ( updatePlayersMoney, 2500, 0 ) 

Link to comment

Player is not defined.

exports [ "scoreboard" ]:addScoreboardColumn ( "group", 3 ) 
function updatePlayersMoney () 
local account = getPlayerAccount(source) 
for index, player in ipairs ( getElementsByType "player" ) do 
local group = getAccountData(account, "group") 
end 
end 
setTimer ( updatePlayersMoney, 2500, 0 ) 

Link to comment

You didn't fix it, still wrong.

exports["scoreboard"]:addScoreboardColumn("group", root, 3) 
  
function updatePlayersMoney() 
    for index, player in ipairs(getElementsByType("player")) do 
        local account = getPlayerAccount(player) 
        if account and not isGuestAccount(account) then 
            local group = getAccountData(account, "group") or "N/A" 
            setElementData(player, "group", group) 
        end 
    end 
end 
setTimer(updatePlayersMoney, 2500, 0) 

Link to comment

@-misterX-: Are you sure your script is server-side? I don't see any issues with that code myself.

maybe because exports work with client side!

Exports are not client-side only. They are both. You should not interfere with something that is incorrect/you are not sure of.

Link to comment

I don't think he has tested my code, the time between my post and his post is one minutes, if not seconds.

i guess he meant Samer code.

If he used it client side, he will get 'attempt to call global' not 'Bad argument'.

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