Jump to content

Support mode help


BeCooL

Recommended Posts

hi guys ,

i need help :\ , what is the problem ?

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    edit = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(284, 101, 730, 555, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(11, 21, 709, 480, false, GUIEditor.window[1]) 
        col = guiGridListAddColumn(GUIEditor.gridlist[1], "Support", 0.9) 
        GUIEditor.edit[1] = guiCreateEdit(9, 504, 705, 41, "", false, GUIEditor.window[1]) 
    guiSetVisible ( GUIEditor.window[1] ,false )     
    end 
) 
  
bindKey ( "J" , "down" , function() 
  
if ( guiGetVisible ( GUIEditor.window[1] ) == true ) then 
 guiSetVisible ( GUIEditor.window[1] ,false ) 
 showCursor (false ) 
  
 elseif ( guiGetVisible ( GUIEditor.window[1] ) == false ) then 
 guiSetVisible ( GUIEditor.window[1] ,true ) 
 showCursor (true ) 
  end 
 end 
 ) 
  
 bindKey ( "enter" , "down" , function() 
 if ( guiGetVisible ( GUIEditor.window[1] ) == true ) then 
 Text = guiGetText ( GUIEditor.edit[1] ) 
 local row = guiGridListAddRow ( GUIEditor.gridlist[1] )  
 guiGridListSetItemText ( GUIEditor.gridlist[1], row, col, Text, false, false ) end 
 end ) 

Link to comment

You should use the event: "onClientGUIAccepted".

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    edit = {} 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(284, 101, 730, 555, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(11, 21, 709, 480, false, GUIEditor.window[1]) 
        col = guiGridListAddColumn(GUIEditor.gridlist[1], "Support", 0.9) 
        GUIEditor.edit[1] = guiCreateEdit(9, 504, 705, 41, "", false, GUIEditor.window[1]) 
        addEventHandler ( "onClientGUIAccepted", GUIEditor.edit[1], updateGridList, false ) 
        guiSetVisible ( GUIEditor.window[1] ,false )     
    end 
) 
  
bindKey ( "J" , "down", 
    function ( )  
        local state = ( not guiGetVisible ( GUIEditor.window[1] ) ) 
        guiSetVisible ( GUIEditor.window[1], state ) 
        showCursor ( state ) 
    end 
) 
  
function updateGridList ( ) 
    local Text = guiGetText ( GUIEditor.edit[1] ) 
    if ( Text ~= "" ) then 
        local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
        guiGridListSetItemText ( GUIEditor.gridlist[1], row, col, Text, 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...