xXMADEXx Posted January 11, 2013 Share Posted January 11, 2013 How can i fix it, so it will list all the in-game players in the colum_name on the 'PlayerList' grid. And how do i make it so that on createVIP_colum_rank in createVIP_grid_rank will have the ranks "Rich-Man, Gold, Silver, Bronze" ? createVIP_wnd = guiCreateWindow(357,172,475,425,"Make A VIP",false) guiWindowSetSizable(createVIP_wnd,false) guiSetVisible(createVIP_wnd,false) createVIP_bnt_makevip = guiCreateButton(9,382,221,34,"Make Him A VIP",false,createVIP_wnd) createVIP_bnt_cancel = guiCreateButton(234,382,221,34,"Cancel",false,createVIP_wnd) playerList = guiCreateGridList(14,22,443,182,false,createVIP_wnd) column_name = guiGridListAddColumn(playerList,"Player",0.-- s8) --> createVIP_grid_rank = guiCreateGridList(14,199,443,182,false,createVIP_wnd) createVIP_colum_rank = guiGridListAddColumn(createCIP_grid_rank,"Rank",0.-- s8) --> bindKey("F1", "down", function ( ) guiSetVisible(createVIP_wnd, not guiGetVisible ( createVIP_wnd )) showCursor(guiGetVisible ( createVIP_wnd )) if ( guiGetVisible ( createVIP_wnd ) ) then guiGridListClear ( playerList ) if ( column ) then for id, player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( playerList ) local r, g, b = getPlayerNametagColor ( player ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) guiGridListSetItemColor ( playerList, row, column, r, g, b ) end end end end ) -- Open Menu --[[function open() guiSetVisible(createVIP_wnd,true) showCursor(true) end addCommandHandler("makevip", open) bindKey("F1","down",open)]] -- Close Menu function close() guiSetVisible(createVIP_wnd,false) showCursor(false,false) end addEventHandler("onClientGUIClick", createVIP_bnt_cancel, close) Link to comment
Castillo Posted January 11, 2013 Share Posted January 11, 2013 bindKey("F1", "down", function ( ) guiSetVisible(createVIP_wnd, not guiGetVisible ( createVIP_wnd )) showCursor(guiGetVisible ( createVIP_wnd )) if ( guiGetVisible ( createVIP_wnd ) ) then guiGridListClear ( playerList ) if ( column_name ) then for id, player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( playerList ) local r, g, b = getPlayerNametagColor ( player ) guiGridListSetItemText ( playerList, row, column_name, getPlayerName ( player ), false, false ) guiGridListSetItemColor ( playerList, row, column_name, r, g, b ) end end if ( createVIP_colum_rank ) then for _, rank in ipairs ( { "Rich-Man", "Gold", "Silver", "Bronze" } ) do local row = guiGridListAddRow ( createVIP_grid_rank ) guiGridListSetItemText ( createVIP_grid_rank, row, createVIP_colum_rank, rank, false, false ) end end end end ) Link to comment
xXMADEXx Posted January 11, 2013 Author Share Posted January 11, 2013 Thank you castillo, but is there a way to get the selected player, and set him to the selected rank? Like, so there is a colum on the scoreboard named "VIP", and how can you make there VIP status to the rank that is selected for the player that is selected. (sorry, i dont really know how to explain it.) and make it on an ACL lock for lvl 5 and lvl 6 Link to comment
Castillo Posted January 11, 2013 Share Posted January 11, 2013 This is to get the selected player and rank: guiGridListGetSelectedItem guiGridListGetItemText To restrict the bind, you'll have to make it server side and using: getPlayerAccount getAccountName isObjectInACLGroup 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