Turbesz Posted July 23, 2016 Share Posted July 23, 2016 (edited) doesn't show players, but gridlist is fine code: bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) local GUIEditor = { button = {}, window = {}, gridlist = {}, } GUIEditor.window[1] = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(646, 20, 26, 26, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, GUIEditor.window[1]) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) local players = getElementsByType("player") for k,v in ipairs(players) do addPlayerToList(v) end guiSetVisible(GUIEditor.window[1],false) addEventHandler("onClientGUIClick",root, function () if source == bb then guiSetVisible(GUIEditor.window[1],true) showCursor ( true ) end end ) function Bezaras() guiSetVisible(GUIEditor.window[1], false) showCursor ( false ) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], Bezaras) Edited July 23, 2016 by Guest Link to comment
Walid Posted July 23, 2016 Share Posted July 23, 2016 There is no function called addPlayerToList() in your code , try this function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end Link to comment
Turbesz Posted July 23, 2016 Author Share Posted July 23, 2016 There is no function called addPlayerToList() in your code , try this function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end doesn't working Link to comment
Walid Posted July 23, 2016 Share Posted July 23, 2016 doesn't working I think you don't know how to use it , try to do it by yourself then post your code here. Link to comment
Turbesz Posted July 23, 2016 Author Share Posted July 23, 2016 doesn't working I think you don't know how to use it , try to do it by yourself then post your code here. bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) local GUIEditor = { button = {}, window = {}, gridlist = {}, } GUIEditor.window[1] = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(646, 20, 26, 26, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, GUIEditor.window[1]) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) local players = getElementsByType("player") for k,v in ipairs(players) do addPlayerToList(v) end function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end guiSetVisible(GUIEditor.window[1],false) addEventHandler("onClientGUIClick",root, function () if source == bb then guiSetVisible(GUIEditor.window[1],true) showCursor ( true ) end end ) function Bezaras() guiSetVisible(GUIEditor.window[1], false) showCursor ( false ) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], Bezaras) Link to comment
Walid Posted July 23, 2016 Share Posted July 23, 2016 what wrong? i told you , you don't know how to use it read my first post again. Link to comment
Turbesz Posted July 23, 2016 Author Share Posted July 23, 2016 what wrong? i told you , you don't know how to use it read my first post again. Link to comment
Walid Posted July 23, 2016 Share Posted July 23, 2016 :3 addEventHandler("onClientResourceStart", resourceRoot, function() yourGui = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(yourGui, false) close = guiCreateButton(646, 20, 26, 26, "X", false, yourGui) guiSetProperty(close, "NormalTextColour", "FFFF0000") bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, yourGui) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) guiSetVisible(yourGui,false) -- events addEventHandler("onClientGUIClick",bb,clickButtonBB,false) addEventHandler ( "onClientGUIClick", close, Bezaras,false) end ) -- add all players to your gridlist function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end -- open the Gui when the player click bb button function clickButtonBB() if not guiGetVisible (yourGui) then guiSetVisible(yourGui,true) showCursor(true) addPlayersToGridlist() else guiSetVisible(yourGui,false) showCursor(false) end end -- close the gui when the player click the close button function Bezaras() if guiGetVisible (yourGui) then guiSetVisible(yourGui, false) showCursor ( false ) end end Link to comment
Turbesz Posted July 23, 2016 Author Share Posted July 23, 2016 Lol ._. xdd Many thanks :DD Link to comment
Walid Posted July 23, 2016 Share Posted July 23, 2016 Lol ._. xddMany thanks :DD You are welcome. 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