Jump to content

Ayuda con guiGridListSetItemText


Recommended Posts

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
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
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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...