AlvareZ_ Posted May 28, 2013 Share Posted May 28, 2013 Hola, en este caso quisiera que me ayudaran con lo siguiente. Lo que quiero es que al darle en la gridlist a la M4 se cree la imagen, Pero no se que error tiene ya me asegure de tener el resource admin iniciado GUIEditor = { gridlist = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(417, 171, 547, 361, "ZombieVille Tienda de Armas", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.99) GUIEditor.gridlist[1] = guiCreateGridList(21, 42, 218, 296, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Arma:", 0.9) guiGridListAddRow(GUIEditor.gridlist[1]) m4 = guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "M4", false, false) function crearm4 (thePlayer) local arma = guiGridListSetItemText ( thePlayer, row, 1 ) if ( arma == "M4" ) then guiCreateStaticImage(94, 40, 147, 126, ":admin/client/images/info.png", false, GUIEditor.window[1]) end end addEventHandler( "onClientGUIClick", m4, crearm4 ) Link to comment
Plate Posted May 28, 2013 Share Posted May 28, 2013 guiGridListGetSelectedItem Esto esta mal local arma = guiGridListSetItemText ( thePlayer, row, 1 ) if ( arma == "M4" ) then Link to comment
Sasu Posted May 28, 2013 Share Posted May 28, 2013 function crearm4 (thePlayer) local row,column = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local arma = guiGridListGetItemText ( thePlayer, row, 1 ) if ( arma == "M4" ) then guiCreateStaticImage(94, 40, 147, 126, ":admin/client/images/info.png", false, GUIEditor.window[1]) end end addEventHandler( "onClientGUIClick", m4, crearm4 ) Link to comment
AlvareZ_ Posted May 28, 2013 Author Share Posted May 28, 2013 No me funciono , Gracias por responder Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 local arma = guiGridListGetItemText ( thePlayer, row, 1 ) Eso no tiene sentido. Link to comment
AlvareZ_ Posted May 28, 2013 Author Share Posted May 28, 2013 que se deberia usar? para verificar que al darle clic le cree la imagen Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 GUIEditor = { gridlist = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(417, 171, 547, 361, "ZombieVille Tienda de Armas", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.99) GUIEditor.gridlist[1] = guiCreateGridList(21, 42, 218, 296, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Arma:", 0.9) guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "M4", false, false) function crearm4 ( ) local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local arma = guiGridListGetItemText ( source, row, 1 ) if ( arma == "M4" ) then guiCreateStaticImage ( 94, 40, 147, 126, ":admin/client/images/info.png", false, GUIEditor.window[1] ) end end end addEventHandler ( "onClientGUIClick", GUIEditor.gridlist[1], crearm4, false ) Link to comment
AlvareZ_ Posted May 28, 2013 Author Share Posted May 28, 2013 Ham ya, Muchas gracias a el igual sasuke y plate Link to comment
AlvareZ_ Posted May 28, 2013 Author Share Posted May 28, 2013 y si quiero que al seleccionar otro se borre el anterior por ejemplo ya sea una lista larga que al darle ak y luego m4 se borre la imagen anterior mente seleccionada como aria ? Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 Podes cambiar la imagen con guiStaticImageLoadImage. Link to comment
AlvareZ_ Posted May 28, 2013 Author Share Posted May 28, 2013 Algo asi ? GUIEditor = { gridlist = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(417, 171, 547, 361, "ZombieVille Tienda de Armas", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.99) GUIEditor.gridlist[1] = guiCreateGridList(21, 42, 218, 296, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Arma:", 0.9) guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "M4", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "AK-47", false, false) local hola = guiCreateStaticImage ( 94, 40, 147, 126, ":admin/client/images/info.png", false, GUIEditor.window[1] ) function crearm4 ( ) local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local arma = guiGridListGetItemText ( source, row, 1 ) if ( arma == "M4" ) then guiStaticImageLoadImage ( hola, "imagen.png" ) end end end addEventHandler ( "onClientGUIClick", GUIEditor.gridlist[1], crearm4, false ) function crearak ( ) local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local arma = guiGridListGetItemText ( source, row, 1 ) if ( arma == "AK-47" ) then guiStaticImageLoadImage ( hola, "nuevaimagen.png" ) end end end addEventHandler ( "onClientGUIClick", GUIEditor.gridlist[1], crearak, false ) Link to comment
Castillo Posted May 28, 2013 Share Posted May 28, 2013 Si, pero no hace falta otra funcion, usa 'elseif'. Link to comment
AlvareZ_ Posted May 28, 2013 Author Share Posted May 28, 2013 Ham ok, Muchas gracias. Link to comment
Recommended Posts