Dannz0r Posted August 17, 2011 Share Posted August 17, 2011 Hello, I would need some help with a GridList, well I created the list and column, but I dont know how to make the column add rows with teams from the scoreboard, here is what I done until now: --[[Panel created by: [FOTL]Danny]]-- --[[On 17th August 2011]]-- teamsList = guiCreateGridList(48,172,186,255,false ) column = guiGridListAddColumn( teamsList, "Teams", 0.85 ) guiWindowSetMovable ( teamsList, false ) guiWindowSetSizable ( teamsList, false ) send = guiCreateButton(90,430,100,25, "Select" ,false) showCursor(true) guiSetVisible(JobsWin, true) And if possible to make this, when player selected a team and hit the button to set him on that team, thank you. Link to comment
Dannz0r Posted August 17, 2011 Author Share Posted August 17, 2011 Someone helped me now it shows the teams now I only need help when you select a team and click the button to set him on that team. Link to comment
JR10 Posted August 17, 2011 Share Posted August 17, 2011 addEventHandler ( "onClientGUIClick", root, function ( button ) if button == "left" then if source == send then local row, col = guiGridListGetSelectedItem ( teamsList ) local teamName = guiGridListGetItemText ( teamsList, row, col ) triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(), teamName ) end end end) server: addEvent ( "onPlayerChooseTeam" , true ) addEventHandler ( "onPlayerChooseTeam" , root , function ( teamName ) local team = getTeamFromName ( teamName ) setPlayerTeam ( source , team ) end ) Link to comment
Dannz0r Posted August 17, 2011 Author Share Posted August 17, 2011 Thank you brother. Link to comment
Dannz0r Posted August 17, 2011 Author Share Posted August 17, 2011 No problem. Can you make something like when player pressed select and it put him on a team to spawn him in a position? dont put the position just put the x/z/y thing give me code I do the rest please. Link to comment
JR10 Posted August 17, 2011 Share Posted August 17, 2011 Umm, you need a table with the teams and the coordinates. here: local teamsTable = { [ "teamName1" ] = { spawnX , spawnY , spawnZ } , [ "teamName2" ] = { spawnX , spawnY , spawnZ } , [ "teamName3" ] = { spawnX , spawnY , spawnZ } } addEvent ( "onPlayerChooseTeam" , true ) addEventHandler ( "onPlayerChooseTeam" , root , function ( teamName ) local team = getTeamFromName ( teamName ) setPlayerTeam ( source , team ) local spawnX , spawnY , spawnZ = unpack ( teamsTable [ teamName ] ) spawnPlayer ( source , spawnX , spawnY , spawnZ ) end ) Link to comment
Dannz0r Posted August 17, 2011 Author Share Posted August 17, 2011 Thank you, its working fine. Everything is perfect. 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