Arsilex Posted June 16, 2012 Share Posted June 16, 2012 function Panel() Panel = guiCreateWindow(850,197,494,410,"",false) guiSetAlpha(Panel,0.75) guiWindowSetMovable(Panel,false) guiWindowSetSizable(Panel,false) Reparar = guiCreateButton(17,31,83,34,"Repair",false,Panel) guiSetAlpha(Reparar,0.80000001192093) guiSetFont(Reparar,"default-bold-small") Cerrar = guiCreateButton(179,348,106,38,"Cerrar",false,Panel) guiSetFont(Cerrar,"default-bold-small") Info = guiCreateMemo(413,21,72,358,"Repair=100\nNitro=500",false,Panel) end function Reparar () triggerServerEvent("onFix", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", Reparar, Reparar, true ) addCommandHandler ( "guimecanico", Panel ) Me falla el addEventHandler ( "onClientGUIClick", Reparar, Reparar, true ) La console dice que el evento 2 es incorrecto y que tiene funcion Link to comment
Castillo Posted June 16, 2012 Share Posted June 16, 2012 1: No deberias llamar a tu funcion como el boton. 2: El event handler tiene que ir dentro de la funcion: Panel ( ), ademas al ultimo tenes que poner "false", no "true", si no cuando presiones otro GUI se ejecutara esa funcion. 3: Usa esto: function Panel() Panel = guiCreateWindow(850,197,494,410,"",false) guiSetAlpha(Panel,0.75) guiWindowSetMovable(Panel,false) guiWindowSetSizable(Panel,false) Reparar = guiCreateButton(17,31,83,34,"Repair",false,Panel) addEventHandler ( "onClientGUIClick", Reparar, RepararVehiculo, false ) guiSetAlpha(Reparar,0.80000001192093) guiSetFont(Reparar,"default-bold-small") Cerrar = guiCreateButton(179,348,106,38,"Cerrar",false,Panel) guiSetFont(Cerrar,"default-bold-small") Info = guiCreateMemo(413,21,72,358,"Repair=100\nNitro=500",false,Panel) end addCommandHandler ( "guimecanico", Panel ) function RepararVehiculo () triggerServerEvent("onFix", getLocalPlayer()) end Link to comment
Recommended Posts