conner12 Posted January 3, 2013 Share Posted January 3, 2013 Bueno le he dado a este script pero no me muestra el gui, ya intente pero no se donde estoy mal. aqui esta el client: function() showwindow = guiCreateWindow(315, 142, 276, 241, "Pilot Job", false) tomar = guiCreateButton(19, 155, 93, 53, "take", false, showwindow) cancelar = guiCreateButton(159, 155, 93, 53, "cancel", false, showwindow) labl = guiCreateLabel(19, 35, 239, 163, "pick up passengers to the location.", false, showwindow) showCursor(true) end addEventHandler( "onClientGuiClick", tomar, takeJ, true) addEventHandler( "onClientGuiClick", cancelar, Exit, true) function show() guiSetVisible (showwindow, true) showCursor (true) end addEvent ("showGUI", true) addEventHandler ("showGUI",root,show) function takeJ() triggerServerEvent("setPilot",localPlayer) showCursor (false) end function Exit() guiSetVisible(showwindow, false) showCursor(false) end por favor necesito ayuda Link to comment
Alexs Posted January 3, 2013 Share Posted January 3, 2013 Creas todo pero jamas lo ejecutas, hay algo mas en el código? function() showwindow = guiCreateWindow(315, 142, 276, 241, "Pilot Job", false) tomar = guiCreateButton(19, 155, 93, 53, "take", false, showwindow) cancelar = guiCreateButton(159, 155, 93, 53, "cancel", false, showwindow) labl = guiCreateLabel(19, 35, 239, 163, "pick up passengers to the location.", false, showwindow) showCursor(true) end addEventHandler( "onClientGuiClick", tomar, takeJ, true) addEventHandler( "onClientGuiClick", cancelar, Exit, true) function show() guiSetVisible (showwindow, true) showCursor (true) end addEvent ("showGUI", true) addEventHandler ("showGUI",root,show) function takeJ() triggerServerEvent("setPilot",localPlayer) showCursor (false) end function Exit() guiSetVisible(showwindow, false) showCursor(false) end Link to comment
AlvareZ_ Posted January 3, 2013 Share Posted January 3, 2013 intenta esto function() showwindow = guiCreateWindow(315, 142, 276, 241, "Pilot Job", false) tomar = guiCreateButton(19, 155, 93, 53, "take", false, showwindow) cancelar = guiCreateButton(159, 155, 93, 53, "cancel", false, showwindow) labl = guiCreateLabel(19, 35, 239, 163, "pick up passengers to the location.", false, showwindow) showCursor(true) end addEventHandler( "onClientGuiClick", tomar, takeJ, true) addEventHandler( "onClientGuiClick", cancelar, Exit, true) function show() guiSetVisible (showwindow, true) showCursor (true) end bindKey ( player, "F2", show ) addEvent ("showGUI", true) addEventHandler ("showGUI",root,show) function takeJ() triggerServerEvent("setPilot",localPlayer) showCursor (false) end function Exit() guiSetVisible(showwindow, false) showCursor(false) end PRECIONA F2 PARA ABRIRLA Link to comment
conner12 Posted January 4, 2013 Author Share Posted January 4, 2013 no creo que no me has entendido, en el server side tengo un marker creado pero cuando triggueo la GUI no me la muestra. Link to comment
Alexs Posted January 4, 2013 Share Posted January 4, 2013 Quizá el error esta en el trigger. Postea el código y revisa el Debugscript. Link to comment
conner12 Posted January 4, 2013 Author Share Posted January 4, 2013 client side: function() showwindow = guiCreateWindow(315, 142, 276, 241, "Pilot Job", false) tomar = guiCreateButton(19, 155, 93, 53, "take", false, showwindow) cancelar = guiCreateButton(159, 155, 93, 53, "cancel", false, showwindow) labl = guiCreateLabel(19, 35, 239, 163, "pick up passengers to the location.", false, showwindow) showCursor(true) end addEventHandler( "onClientGuiClick", tomar, takeJ, true) addEventHandler( "onClientGuiClick", cancelar, Exit, true) function show() guiSetVisible (showwindow, true) showCursor (true) end addEvent ("showGUI", true) addEventHandler ("showGUI",root,show) function takeJ() triggerServerEvent("setPilot",localPlayer) showCursor (false) end function Exit() guiSetVisible(showwindow, false) showCursor(false) end server side: blip = createBlip ( 1968, -2187.7998046875, 12.5, 56 ) marcadorgui = createMarker (1968, -2187.7998046875, 12.5, "cylinder", 1.5, 255, 255, 0, 200) function showGUI2 (player) if (isPedInVehicle (player)) then return end triggerClientEvent (player,"showGUI",getRootElement(),player) end addEventHandler ("onMarkerHit",marcadorgui,showGUI2) function createpilotTeam() PilotTeam = createTeam ("Pilot", 255, 255, 0) end addEventHandler ("onResourceStart", resourceRoot, createpilotTeam) function joinpilot() setPlayerTeam(source,PilotTeam) setElementModel (source, 61) setPlayerNametagColor ( source, 255, 255, 0 ) outputChatBox("You are now employed as pilot.",source,0,255,0) end addEvent("setPilot", true) addEventHandler("setPilot",root,joinpilot) Link to comment
Recommended Posts