Jump to content

Error con addEvent


Mimimiguel

Recommended Posts

¡Hola! Bueno, tengo un problema con addEvent, el caso es que no me lo detecta como añadido y me da error de "server triggered event nombredelevento but it isnt added clientside", lo cual es mentira, además, tengo dos eventos añadidos clientside y sólo uno me da error, lo cual me desconcierta :shock:

Este es el código del cliente:

addEvent( "infracciones:load", true ) 
addEvent( "infracciones:show", true ) 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Grid = {} 
GUIEditor_Grid_Column = {} 
  
GUIEditor_Window[1] = guiCreateWindow(212,89,611,540,"Infracciones de tráfico",false) 
guiSetVisible( GUIEditor_Window[1], false ) 
GUIEditor_Grid[1] = guiCreateGridList(12,27,590,468,false,GUIEditor_Window[1]) 
GUIEditor_Grid_Column[1] = guiGridListAddColumn(GUIEditor_Grid[1],"Modelo",0.12) 
GUIEditor_Grid_Column[6] = guiGridListAddColumn(GUIEditor_Grid[1],"Propietario",0.2) 
GUIEditor_Grid_Column[2] = guiGridListAddColumn(GUIEditor_Grid[1],"Matrícula",0.15) 
GUIEditor_Grid_Column[3] = guiGridListAddColumn(GUIEditor_Grid[1],"Infracción",0.15) 
GUIEditor_Grid_Column[4] = guiGridListAddColumn(GUIEditor_Grid[1],"Lugar de infracción",0.2) 
GUIEditor_Grid_Column[5] = guiGridListAddColumn(GUIEditor_Grid[1],"Fecha",0.2) 
GUIEditor_Button[1] = guiCreateButton(224,501,178,30,"Cerrar",false,GUIEditor_Window[1]) 
  
function toggleWindow() 
    if guiGetVisible( GUIEditor_Window[1] ) == true then 
        guiSetVisible( GUIEditor_Window[1], false ) 
        showCursor( false ) 
    else 
        guiSetVisible( GUIEditor_Window[1], true ) 
        showCursor( true ) 
    end 
end 
addEventHandler( "infracciones:show", getLocalPlayer(), toggleWindow) 
addEventHandler( "onClientGUIClick", GUIEditor_Button[1], toggleWindow) 
  
function cargarInfracciones( id, model, plate, atype, place, adate, owner ) 
    if model and plate and atype and place and adate then 
        name = getVehicleNameFromModel( model ) 
        row = guiGridListAddRow( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[1], name, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[2], plate, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[3], atype, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[4], place, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[5], adate, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[6], owner, false, false ) 
    end 
end 
addEventHandler( "infracciones:load", GUIEditor_Window[1], cargarInfracciones) 

Me da el error en el evento "infracciones:load"

Gracias de antemano.

Link to comment
addEvent( "infracciones:load", true ) 
addEvent( "infracciones:show", true ) 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Grid = {} 
GUIEditor_Grid_Column = {} 
  
GUIEditor_Window[1] = guiCreateWindow(212,89,611,540,"Infracciones de tráfico",false) 
guiSetVisible( GUIEditor_Window[1], false ) 
GUIEditor_Grid[1] = guiCreateGridList(12,27,590,468,false,GUIEditor_Window[1]) 
GUIEditor_Grid_Column[1] = guiGridListAddColumn(GUIEditor_Grid[1],"Modelo",0.12) 
GUIEditor_Grid_Column[6] = guiGridListAddColumn(GUIEditor_Grid[1],"Propietario",0.2) 
GUIEditor_Grid_Column[2] = guiGridListAddColumn(GUIEditor_Grid[1],"Matrícula",0.15) 
GUIEditor_Grid_Column[3] = guiGridListAddColumn(GUIEditor_Grid[1],"Infracción",0.15) 
GUIEditor_Grid_Column[4] = guiGridListAddColumn(GUIEditor_Grid[1],"Lugar de infracción",0.2) 
GUIEditor_Grid_Column[5] = guiGridListAddColumn(GUIEditor_Grid[1],"Fecha",0.2) 
GUIEditor_Button[1] = guiCreateButton(224,501,178,30,"Cerrar",false,GUIEditor_Window[1]) 
  
function toggleWindow ( ) 
    if guiGetVisible( GUIEditor_Window[1] ) == true then 
        guiSetVisible( GUIEditor_Window[1], false ) 
        showCursor( false ) 
    else 
        guiSetVisible( GUIEditor_Window[1], true ) 
        showCursor( true ) 
    end 
end 
addEventHandler( "infracciones:show", getLocalPlayer(), toggleWindow) 
addEventHandler( "onClientGUIClick", GUIEditor_Button[1], toggleWindow) 
  
function cargarInfracciones( id, model, plate, atype, place, adate, owner ) 
    if ( model and plate and atype and place and adate ) then 
        name = getVehicleNameFromModel( model ) 
        row = guiGridListAddRow( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[1], name, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[2], plate, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[3], atype, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[4], place, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[5], adate, false, false ) 
        guiGridListSetItemText( GUIEditor_Grid[1], row, GUIEditor_Grid_Column[6], owner, false, false ) 
    end 
end 
addEventHandler( "infracciones:load", root, cargarInfracciones) 

Proba con eso.

Link to comment
  • Recently Browsing   0 members

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