MisterQuestions Posted June 29, 2014 Share Posted June 29, 2014 I have a dude, how to create a playerlist on a previous created gridlist, i dont know how to create that player list and select players to make the action of the buton. (sorry for the bad english) Link to comment
aintaro Posted June 29, 2014 Share Posted June 29, 2014 local GUIEditor { window = {}, gridlist = {} } function showPlayerList() GUIEditor.window[1] = guiCreateWindow(0.40, 0.25, 0.19, 0.41, "Player list", true) GUIEditor.gridlist[1] = guiCreateGridList(10, 36, 278, 253, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Players", 0.9) local players = getElementsByType("player") for i, v in ipairs(players) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText ( GUIEditor.gridlist[1], row, column, v, false, false ) end showCursor(true) end addCommandHandler("showplayers", showPlayerList) Link to comment
Et-win Posted June 29, 2014 Share Posted June 29, 2014 Player and Gridlist functions: getElementsByType guiGridListAddRow guiGridListSetItemText Link to comment
MisterQuestions Posted June 29, 2014 Author Share Posted June 29, 2014 I already have it like that, but it only shows me :C why? Link to comment
MisterQuestions Posted June 29, 2014 Author Share Posted June 29, 2014 Here is it. function SetRank() window_panel = guiCreateWindow(346, 141, 322, 522, "Set Rank Panel", false) guiWindowSetSizable(window_panel, false) tab_panel = guiCreateTabPanel(9, 30, 303, 482, false, window_panel) tab_rank = guiCreateTab("Set Rank", tab_panel) playergrid = guiCreateGridList(8, 15, 145, 432, false, tab_rank) column = guiGridListAddColumn( playergrid, "Players", 0.85 ) for id, player in ipairs(getElementsByType("player")) do row = guiGridListAddRow ( playergrid ) guiGridListSetItemText ( playergrid, row, column, getPlayerName ( player ), false, false ) playerName = guiGridListGetItemText ( playergrid, guiGridListGetSelectedItem ( playergrid ), 1 ) TrialMember = guiCreateButton(161, 33, 132, 38, "Give Trial-Member", false, tab_rank) Moderator = guiCreateButton(161, 129, 132, 38, "Give Moderator", false, tab_rank) Member = guiCreateButton(161, 81, 132, 38, "Give Member", false, tab_rank) SModerator = guiCreateButton(161, 177, 132, 38, "Give S.Moderator", false, tab_rank) Administrator = guiCreateButton(161, 225, 132, 38, "Give Administrator", false, tab_rank) TeamMananger = guiCreateButton(161, 273, 132, 38, "Give Team Mananger", false, tab_rank) ranklabel = guiCreateLabel(158, 332, 135, 27, "Current Rank:", false, tab_rank) showCursor(true, true) addEventHandler ("OnClientGUIClick", Trial-Member, SetTrial) end end Then? Whats wrong? Link to comment
MisterQuestions Posted June 29, 2014 Author Share Posted June 29, 2014 Nope, its everythins ok Link to comment
Et-win Posted June 29, 2014 Share Posted June 29, 2014 You know, that you are creating every button as much times as players are online, don't you do? EDIT: Anyway, every player who is online will be shown in the gridlist. Link to comment
MisterQuestions Posted July 2, 2014 Author Share Posted July 2, 2014 But, i tried on my server, whith players, and only shows me Link to comment
MisterQuestions Posted July 5, 2014 Author Share Posted July 5, 2014 I dont know what to do, doesn't works why? 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