Ranous Posted June 10, 2016 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
ViRuZGamiing Posted June 10, 2016 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
Ranous Posted June 10, 2016 Author Posted June 10, 2016 The errors is gone now but it doesn't work. (A new row isn't added.)
ViRuZGamiing Posted June 10, 2016 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
Ranous Posted June 10, 2016 Author Posted June 10, 2016 Player is already in the team but it doesn't work.
Anubhav Posted June 10, 2016 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
Anubhav Posted June 10, 2016 Posted June 10, 2016 It doesn't work. What should I do ? Add outputChatBox's and debug it.
ViRuZGamiing Posted June 10, 2016 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.
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