Jump to content

Gridlist Problem :/


iFoReX

Recommended Posts

my row create down :/

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0,0.6583,0.2212,0.35,"GUI Garage",true) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Button[1] = guiCreateButton(10,57,157,43,"Sacar Vehiculo",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(10,108,157,43,"Cambiar de color el Vehiculo",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(10,159,157,42,"Cambiar/poner Paintjob",false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(53,29,56,16,"By ElMota",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Button[4] = guiCreateButton(141,22,25,29,"X",false,GUIEditor_Window[1]) 
GUIEditor_Window[2] = guiCreateWindow(-0.005,0.0917,0.2275,0.5667,"GUI Autos",true) 
GUIEditor_Grid[1] = guiCreateGridList(9,28,164,303,false,GUIEditor_Window[2]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
column = guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.-- s8) -->
  
column2 = guiGridListAddColumn(GUIEditor_Grid[1],"ID",0.2) 
  
GUIEditor_Window[3] = guiCreateWindow(0.2212,0.6583,0.2675,0.3483,"GUI Agregar Auto",true) 
GUIEditor_Button[5] = guiCreateButton(13,164,187,33,"Agregar",false,GUIEditor_Window[3]) 
GUIEditor_Label[2] = guiCreateLabel(17,31,125,17,"Nombre de la Variable",false,GUIEditor_Window[3]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Edit[1] = guiCreateEdit(17,49,187,29,"",false,GUIEditor_Window[3]) 
GUIEditor_Label[3] = guiCreateLabel(19,90,123,22,"Numero de ID",false,GUIEditor_Window[3]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[2] = guiCreateEdit(17,107,187,29,"",false,GUIEditor_Window[3]) 
  
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
guiSetVisible(GUIEditor_Window[3],false) 
showCursor(false) 
  
marker = createMarker( 250.27734375, -1765.474609375, 3.7, "cylinder", 1.5, 255, 255, 255, 90 ) 
  
function markerHit(hitPlayer) 
name = getPlayerName( localPlayer ) 
    if name == "ElMota(BienNice)" then 
        if ( hitPlayer == localPlayer ) then 
        guiSetVisible (GUIEditor_Window[1], true) 
        guiSetVisible (GUIEditor_Window[2], true) 
        guiSetVisible (GUIEditor_Window[3], true) 
        showCursor (true) 
        triggerServerEvent("onCameraView", getLocalPlayer()) 
        end 
    end 
end 
  
addEventHandler("onClientMarkerHit", marker, markerHit) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[4] then 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
guiSetVisible(GUIEditor_Window[3],false) 
showCursor(false) 
setCameraTarget( localPlayer ) 
end 
end 
) 
  
function CrearLosVehiculo() 
if source == GUIEditor_Button[5] then 
local row = guiGridListAddRow(GUIEditor_Grid[1]) 
guiGridListSetItemText ( GUIEditor_Grid[1], row, column, (guiGetText(GUIEditor_Edit[1])), false, false ) 
end 
end 
addEventHandler("onClientGUIClick", root, CrearLosVehiculo) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[5] then 
local row2 = guiGridListAddRow(GUIEditor_Grid[1]) 
guiGridListSetItemText ( GUIEditor_Grid[1], row2, column2, (guiGetText(GUIEditor_Edit[2])), false, false ) 
end 
end 
) 

here a image

mtascreen20120430010241.png

Link to comment
Guest Guest4401
very thnx u :) work 100%

You're welcome.

OFF-Topic : I pressed remove instead of edit accidently, here's the old post if you or someone else needed:

It was because you added two rows, row and row2.

Try replacing line 67 to 82 with this:

addEventHandler("onClientGUIClick", root, 
    function() 
        if source == GUIEditor_Button[5] then 
            local row = guiGridListAddRow(GUIEditor_Grid[1]) 
            guiGridListSetItemText ( GUIEditor_Grid[1], row, column, (guiGetText(GUIEditor_Edit[1])), false, false ) 
            guiGridListSetItemText ( GUIEditor_Grid[1], row, column2, (guiGetText(GUIEditor_Edit[2])), false, false ) 
        end 
    end 
) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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