Jump to content

Ayuda con diferentes "GUI"


JesusAliso

Recommended Posts

Buenas. Estoy creando un "Spawn" para mi servidor... y necesito una ayuda con esto :/

Gridlist:

gridlist1 = guiCreateGridList(9, 23, 176, 157, false, ventana1) 
guiGridListAddColumn(gridlist1, "Ciudad:", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(gridlist1) 
end 
gui1 = guiGridListSetItemText(gridlist1, 0, 1, "San Fierro", false, false) 
gui2 = guiGridListSetItemText(gridlist1, 1, 1, "Las Venturas", false, false) 
gui3 = guiGridListSetItemText(gridlist1, 2, 1, "Los Santos", false, false) 
  
gridlist2 = guiCreateGridList(205, 23, 176, 157, false, ventana1) 
guiGridListAddColumn(gridlist2, "Clases:", 0.9) 

Bueno, me explico. como podría hacer para que cuando seleccione que si "San Fierro" en la (gridlist1) se creen los "row" en la segunda (gridlist2).

Intente así:

addEventHandler ("onClientGUIClick", gui1, sanfierro, false) 
  
function sanfierro () 
    guiGridListSetItemText(gridlist2, 0, 1, "Civiles", false, false) 
    guiGridListSetItemText(gridlist2, 1, 1, "Agentes Especiales", false, false) 
    guiGridListSetItemText(gridlist2, 2, 1, "Criminales", false, false) 
end 

PD: Todo lo hice con el recurso "guieditor".

Link to comment
function sanfierro ( ) 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Civiles", false, false ) 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Agentes Especiales", false, false ) 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Criminales", false, false ) 
end 
addEventHandler ( "onClientGUIClick", gui1, sanfierro, false ) 

Link to comment

Solo tengo todo el spawn, creado por "guieditor" pero no tienen ninguna funcion por los momentos.

Aquí todo:

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
GUIEditor = { 
    gridlist = {}, 
    label = {} 
} 
ventana1 = guiCreateWindow(623, 278, 391, 486, "RPG:Server | Seleccion de Clases |", false) 
guiWindowSetMovable(ventana1, false) 
guiWindowSetSizable(ventana1, false) 
guiSetAlpha(ventana1, 0.73) 
  
gridlist1 = guiCreateGridList(9, 23, 176, 157, false, ventana1) 
guiGridListAddColumn(gridlist1, "Ciudad:", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(gridlist1) 
end 
gui1 = guiGridListSetItemText(gridlist1, 0, 1, "San Fierro", false, false) 
gui2 = guiGridListSetItemText(gridlist1, 1, 1, "Las Venturas", false, false) 
gui3 = guiGridListSetItemText(gridlist1, 2, 1, "Los Santos", false, false) 
  
gridlist2 = guiCreateGridList(205, 23, 176, 157, false, ventana1) 
guiGridListAddColumn(gridlist2, "Clases:", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(gridlist2) 
end 
  
gridlist3 = guiCreateGridList(205, 190, 176, 214, false, ventana1) 
guiGridListAddColumn(gridlist3, "Personas:", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(gridlist3) 
end 
skins = guiCreateGridList(9, 190, 176, 214, false, ventana1) 
boton1 = guiCreateButton(9, 409, 35, 18, "<", false, ventana1) 
guiSetProperty(boton1, "NormalTextColour", "FFAAAAAA") 
boton2 = guiCreateButton(150, 409, 35, 18, ">", false, ventana1) 
guiSetProperty(boton2, "NormalTextColour", "FFAAAAAA") 
imagen1 = guiCreateStaticImage(204, 420, 177, 56, ":guieditor/images/examples/mtalogo.png", false, ventana1) 
  
ventana2 = guiCreateWindow(623, 176, 391, 102, "RPG:Server | Clase Informacion |", false) 
guiWindowSetSizable(ventana2, false) 
guiSetAlpha(ventana2, 0.70) 
  
memo1 = guiCreateMemo(9, 21, 372, 71, "", false, ventana2) 
guiMemoSetReadOnly(memo1, true) 
  
        showCursor (true) 
    end 
) 
  
function sanfierro () 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Civiles", false, false ) 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Agentes Especiales", false, false ) 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Criminales", false, false ) 
end 
addEventHandler ( "onClientGUIClick", gui1, sanfierro, false ) 
  

Link to comment
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
GUIEditor = { 
    gridlist = {}, 
    label = {} 
} 
ventana1 = guiCreateWindow(623, 278, 391, 486, "RPG:Server | Seleccion de Clases |", false) 
guiWindowSetMovable(ventana1, false) 
guiWindowSetSizable(ventana1, false) 
guiSetAlpha(ventana1, 0.73) 
  
gridlist1 = guiCreateGridList(9, 23, 176, 157, false, ventana1) 
guiGridListAddColumn(gridlist1, "Ciudad:", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(gridlist1) 
end 
gui1 = guiGridListSetItemText(gridlist1, 0, 1, "San Fierro", false, false) 
gui2 = guiGridListSetItemText(gridlist1, 1, 1, "Las Venturas", false, false) 
gui3 = guiGridListSetItemText(gridlist1, 2, 1, "Los Santos", false, false) 
  
gridlist2 = guiCreateGridList(205, 23, 176, 157, false, ventana1) 
guiGridListAddColumn(gridlist2, "Clases:", 0.9) 
  
gridlist3 = guiCreateGridList(205, 190, 176, 214, false, ventana1) 
guiGridListAddColumn(gridlist3, "Personas:", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(gridlist3) 
end 
skins = guiCreateGridList(9, 190, 176, 214, false, ventana1) 
boton1 = guiCreateButton(9, 409, 35, 18, "<", false, ventana1) 
guiSetProperty(boton1, "NormalTextColour", "FFAAAAAA") 
boton2 = guiCreateButton(150, 409, 35, 18, ">", false, ventana1) 
guiSetProperty(boton2, "NormalTextColour", "FFAAAAAA") 
imagen1 = guiCreateStaticImage(204, 420, 177, 56, ":guieditor/images/examples/mtalogo.png", false, ventana1) 
  
ventana2 = guiCreateWindow(623, 176, 391, 102, "RPG:Server | Clase Informacion |", false) 
guiWindowSetSizable(ventana2, false) 
guiSetAlpha(ventana2, 0.70) 
  
memo1 = guiCreateMemo(9, 21, 372, 71, "", false, ventana2) 
guiMemoSetReadOnly(memo1, true) 
  
        showCursor (true) 
        --------------------------- 
    addEventHandler ( "onClientGUIClick", gui1, sanfierro, false ) 
    end 
) 
  
function sanfierro () 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Civiles", false, false ) 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Agentes Especiales", false, false ) 
    guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Criminales", false, false ) 
end 

Link to comment
function sanfierro ( ) 
    local row, col = guiGridListGetSelectedItem ( gridlist1 ) 
    if ( row and col and row ~= -1 and col ~= -1 ) then 
        local cityName = guiGridListGetItemText ( gridlist1, row, col ) 
        if ( cityName == "San Fierro" ) then 
            guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Civiles", false, false ) 
            guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Agentes Especiales", false, false ) 
            guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Criminales", false, false ) 
        end 
    end 
end 

Link to comment
  • Recently Browsing   0 members

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