Ranous Posted June 10, 2016 Share Posted June 10, 2016 Hi Guys, I'm doing the clan panel but i don't know the use of the required functions. I tried to do, i've failed. İt's debug message of the script: Code: clanGrid = guiCreateGridList (5,8,392,228,false,clanTab) usernamePlayer = guiGridListAddColumn( clanGrid, "Username", 0.2 ) for id,players in ipairs(getPlayersInTeam(getPlayerTeam(getLocalPlayer()))) do local playerTeam = guiGridListAddRow ( clanGrid ) guiGridListSetItemText ( clanGrid, playerTeam, usernamePlayer, getPlayerName ( players ), false, false ) end Link to comment
ViRuZGamiing Posted June 10, 2016 Share Posted June 10, 2016 It appears that the localPlayer isn't in a team since getPlayerTeam returns false throw a if (getPlayerTeam(getLocalPlayer())) then around it Link to comment
Ranous Posted June 10, 2016 Author Share Posted June 10, 2016 The errors is gone now but it doesn't work. (A new row isn't added.) Link to comment
ViRuZGamiing Posted June 10, 2016 Share Posted June 10, 2016 Is the player in a team? Cause indeed there shouldn't be a error now but you'll still need to be in a team Link to comment
Ranous Posted June 10, 2016 Author Share Posted June 10, 2016 Player is already in the team but it doesn't work. Link to comment
Anubhav Posted June 10, 2016 Share Posted June 10, 2016 It appears that the localPlayer isn't in a team since getPlayerTeam returns falsethrow a if (getPlayerTeam(getLocalPlayer())) then around it It actually returns nil if I'm right and not false. clanGrid = guiCreateGridList (5,8,392,228,false,clanTab) usernamePlayer = guiGridListAddColumn( clanGrid, "Username", 0.2 ) if getPlayerTeam( localPlayer ) then local team = getPlayerTeam( localPlayer ) for id,players in ipairs(getPlayersInTeam( team )) do local playerTeam = guiGridListAddRow ( clanGrid ) guiGridListSetItemText ( clanGrid, playerTeam, 1, getPlayerName ( players ), false, false ) end end maybe this should work Link to comment
Ranous Posted June 10, 2016 Author Share Posted June 10, 2016 It doesn't work. What should I do ? Link to comment
Anubhav Posted June 10, 2016 Share Posted June 10, 2016 It doesn't work. What should I do ? Add outputChatBox's and debug it. Link to comment
Ranous Posted June 10, 2016 Author Share Posted June 10, 2016 The problem is solved by 8Q. Thanks. Link to comment
ViRuZGamiing Posted June 10, 2016 Share Posted June 10, 2016 It appears that the localPlayer isn't in a team since getPlayerTeam returns falsethrow a if (getPlayerTeam(getLocalPlayer())) then around it It actually returns nil if I'm right and not false. clanGrid = guiCreateGridList (5,8,392,228,false,clanTab) usernamePlayer = guiGridListAddColumn( clanGrid, "Username", 0.2 ) if getPlayerTeam( localPlayer ) then local team = getPlayerTeam( localPlayer ) for id,players in ipairs(getPlayersInTeam( team )) do local playerTeam = guiGridListAddRow ( clanGrid ) guiGridListSetItemText ( clanGrid, playerTeam, 1, getPlayerName ( players ), false, false ) end end maybe this should work Returns Returns a team element representing the team the player is on, false if the player is not part of a team. 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