FSXTim Posted June 11, 2012 Share Posted June 11, 2012 Hello, I have a small problem with my script, it's a playerlist. 'name', 'playingtime' and 'ping' are list in the playerlist. 1. At 'rang', there is 'false', and not the 'status' (state). 2. At 'nr', there is nothing. Error: Bad argument @ 'guiSetText' [Expected string at argument 2, got nil] at this line: guiSetText ( playerListLabels[k][4], nr ) function reFillPlayerList () for key, index in pairs ( playerListLabels ) do for i = 1, 5 do guiSetText ( playerListLabels[key][i], "" ) end end local i = 0 local k = 0 local name, rang, playingtime, ping for key, index in pairs ( playersOnline ) do i = i + 1 if k > maxPlayersInCurList then break end if i >= curPlayerListPosition then k = k + 1 name = getPlayerName(index) rang = tostring(getElementData(index,"Status")) ping = tonumber(getPlayerPing(index)) nr = tonumber(getElementData(index, "Wins")) playingtime = getElementData ( index, "PlayedH" ) playingtime = math.floor ( playingtime / 60 )..":"..( playingtime - math.floor ( playingtime / 60 ) * 60 ) guiSetText ( playerListLabels[k][1], name ) guiSetText ( playerListLabels[k][2], rang ) guiSetText ( playerListLabels[k][3], playingtime ) guiSetText ( playerListLabels[k][4], nr ) guiSetText ( playerListLabels[k][5], ping ) pr, pg, pb = getPingColor ( ping ) guiLabelSetColor ( playerListLabels[k][5], pr, pg, pb ) end end end Greets Link to comment
FSXTim Posted June 11, 2012 Author Share Posted June 11, 2012 I found a solution. Greets 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