-misterX- Posted January 6, 2013 Share Posted January 6, 2013 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
Baseplate Posted January 6, 2013 Share Posted January 6, 2013 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
TAPL Posted January 6, 2013 Share Posted January 6, 2013 What the point of getting the account data and doing nothing with it? Link to comment
Baseplate Posted January 6, 2013 Share Posted January 6, 2013 Ask him that, maybe he have his own system or we dunno, I just fixed the part he asked to help him with. Link to comment
TAPL Posted January 6, 2013 Share Posted January 6, 2013 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- Posted January 6, 2013 Author Share Posted January 6, 2013 it still give badargument Link to comment
K4stic Posted January 6, 2013 Share Posted January 6, 2013 maybe because exports work with client side! Link to comment
myonlake Posted January 7, 2013 Share Posted January 7, 2013 @-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
TAPL Posted January 7, 2013 Share Posted January 7, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now