Jump to content

ayuda no me muestra el GUI


conner12

Recommended Posts

Posted

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

Posted

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 
  

Posted

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

Posted

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) 
  

  • Recently Browsing   0 members

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