Jump to content

Need help with Another GUI!


toptional

Recommended Posts

Got another problem

My problem is when you enter the marker the GUI shows but clicking the button doesnt take you to the place set

spawnmarker = createMarker ( 1969.9000244141, -1517.8000488281, 970.79998779297 , "cylinder",  2, 9, 30, 213, 255 ) 
   
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Label = {} 
  
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        GUIEditor_Window[2] = guiCreateWindow(147,141,749,548,"The Aviator Spawn Panel by Robbster",false) 
        guiSetVisible ( GUIEditor_Window[2], false ) 
        GUIEditor_Memo[2] = guiCreateMemo(80,56,627,302,'Welcome to to the Aviators Airline Gamemode!t\n\n-----\nINFO\nINFO \nINFO\nINFO\n-------\n\nHere are the ranks\n\nA student pilot is 0 points : These can fly everything except the Andromada, AT-400, military planes and military helicopters (hydra/hunter)\n\nA Private pilot is 150 points : These can fly everything except the Andromada and AT-400, and military planes and helicopters (hydra/hunter) and flying with the shamal will be x1.5 the amount of money a student pilot earns\n\nA Commercial pilot is 250 points  : These can fly everything except the military planes and helicopters (hydra/hunter)\n\nArmy pilots is 500 points : These can fly everything\nIn an airline, all airplanes of the airline can be used not matter what \"level\" you are.',false,GUIEditor_Window[2]) 
        GUIEditor_Label[2] = guiCreateLabel(270,398,94,46,"",false,GUIEditor_Window[2]) 
        GUIEditor_Button[2] = guiCreateButton(280,401,194,92,"Lets get to Work Pilot!",false,GUIEditor_Window[2]) 
    end 
) 
  
function MarkerHit ( hitPlayer, matchingDimension ) 
    if ( hitPlayer == localPlayer ) then 
        guiSetVisible ( GUIEditor_Window[2], true ) 
        showCursor ( true ) 
    end 
end 
addEventHandler ( "onClientMarkerHit", spawnmarker, MarkerHit ) 
  
addEventHandler ( 'onClientGUIClick', GUIEditor_Button[2], 
    function ( ) 
        setElementPosition ( localPlayer, 1679.3029785156, 1446.3712158203, 11.043098449707 ) 
        setCameraTarget ( localPlayer ) 
        fadeCamera ( true ) 
        guiSetVisible ( GUIEditor_Window[2], false ) --shows GUI 
        showCursor ( false ) --shows cursor 
    end 
    ,false 
) 
  

Link to comment

Try this. A lot less lines and unnecessary stuff and should work, can't see why it wouldn't.

Client-side

local spawnmarker = createMarker(1969.9000244141, -1517.8000488281, 970.79998779297 , "cylinder",  2, 9, 30, 213, 255) 
  
addEventHandler("onClientMarkerHit", spawnmarker, 
    function(hitElement, matchingDimension) 
        if getElementType(hitElement) == "player" and matchingDimension then 
            if not isElement(GUIEditor_Window[2]) then 
                GUIEditor_Window = {} 
                GUIEditor_Button = {} 
                GUIEditor_Memo = {} 
                GUIEditor_Label = {} 
                 
                GUIEditor_Window[2] = guiCreateWindow(147, 141, 749, 548, "The Aviator Spawn Panel by Robbster", false) 
                GUIEditor_Memo[2] = guiCreateMemo(80,56,627,302,'Welcome to to the Aviators Airline Gamemode!t\n\n-----\nINFO\nINFO \nINFO\nINFO\n-------\n\nHere are the ranks\n\nA student pilot is 0 points : These can fly everything except the Andromada, AT-400, military planes and military helicopters (hydra/hunter)\n\nA Private pilot is 150 points : These can fly everything except the Andromada and AT-400, and military planes and helicopters (hydra/hunter) and flying with the shamal will be x1.5 the amount of money a student pilot earns\n\nA Commercial pilot is 250 points  : These can fly everything except the military planes and helicopters (hydra/hunter)\n\nArmy pilots is 500 points : These can fly everything\nIn an airline, all airplanes of the airline can be used not matter what \"level\" you are.', false, GUIEditor_Window[2]) 
                GUIEditor_Label[2] = guiCreateLabel(270, 398, 94, 46, "", false, GUIEditor_Window[2]) 
                GUIEditor_Button[2] = guiCreateButton(280, 401, 194, 92, "Lets get to Work Pilot!", false, GUIEditor_Window[2]) 
                showCursor(true) 
                 
                addEventHandler("onClientGUIClick", GUIEditor_Button[2], 
                    function(hitElement) 
                        setElementPosition(hitElement, 1679.3029785156, 1446.3712158203, 11.043098449707) 
                        setCameraTarget(hitElement) 
                        fadeCamera(true) 
                        destroyElement(GUIEditor_Window[2]) 
                        showCursor(false) 
                    end 
                , false) 
            else 
                guiBringToFront(GUIEditor_Window[2]) 
            end 
        end 
    end 
) 

Link to comment
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Label = {} 
  
mainGUI = guiCreateWindow(147,141,749,548,"The Aviator Spawn Panel by Robbster",false) 
guiSetVisible ( mainGUI, false ) 
GUIEditor_Memo[2] = guiCreateMemo(80,56,627,302,'Welcome to to the Aviators Airline Gamemode!t\n\n-----\nINFO\nINFO \nINFO\nINFO\n-------\n\nHere are the ranks\n\nA student pilot is 0 points : These can fly everything except the Andromada, AT-400, military planes and military helicopters (hydra/hunter)\n\nA Private pilot is 150 points : These can fly everything except the Andromada and AT-400, and military planes and helicopters (hydra/hunter) and flying with the shamal will be x1.5 the amount of money a student pilot earns\n\nA Commercial pilot is 250 points  : These can fly everything except the military planes and helicopters (hydra/hunter)\n\nArmy pilots is 500 points : These can fly everything\nIn an airline, all airplanes of the airline can be used not matter what \"level\" you are.',false,mainGUI) 
GUIEditor_Label[2] = guiCreateLabel(270,398,94,46,"",false,mainGUI) 
pilotButton = guiCreateButton(280,401,194,92,"Lets get to Work Pilot!",false,mainGUI) 
  
local localPlayer = getLocalPlayer ( ) 
        
local spawnmarker = createMarker ( 1969.9000244141, -1517.8000488281, 970.79998779297 , "cylinder",  2, 9, 30, 213, 255 ) 
  
function MarkerHit ( hitPlayer, matchingDimension ) 
   if getElementType(hitElement) == "player" and hitElement == localPlayer then 
        guiSetVisible ( mainGUI, true ) 
        showCursor ( true ) 
    end 
end 
addEventHandler ( "onClientMarkerHit", spawnmarker, MarkerHit ) 
  
function pilotChange() 
    if (source == pilotButton) then 
      setElementPosition ( localPlayer, 1679.3029785156, 1446.3712158203, 11.043098449707 ) 
        guiSetVisible ( mainGUI, false ) --hides GUI 
        showCursor ( false ) --hides cursor 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), pilotChange) 

Edited by Guest
Link to comment

Try :

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Label = {} 
  
mainGUI = guiCreateWindow(147,141,749,548,"The Aviator Spawn Panel by Robbster",false) 
guiSetVisible ( mainGUI, false ) 
GUIEditor_Memo[2] = guiCreateMemo(80,56,627,302,'Welcome to to the Aviators Airline Gamemode!t\n\n-----\nINFO\nINFO \nINFO\nINFO\n-------\n\nHere are the ranks\n\nA student pilot is 0 points : These can fly everything except the Andromada, AT-400, military planes and military helicopters (hydra/hunter)\n\nA Private pilot is 150 points : These can fly everything except the Andromada and AT-400, and military planes and helicopters (hydra/hunter) and flying with the shamal will be x1.5 the amount of money a student pilot earns\n\nA Commercial pilot is 250 points  : These can fly everything except the military planes and helicopters (hydra/hunter)\n\nArmy pilots is 500 points : These can fly everything\nIn an airline, all airplanes of the airline can be used not matter what \"level\" you are.',false,mainGUI) 
GUIEditor_Label[2] = guiCreateLabel(270,398,94,46,"",false,mainGUI) 
pilotButton = guiCreateButton(280,401,194,92,"Lets get to Work Pilot!",false,mainGUI) 
  
local localPlayer = getLocalPlayer ( ) 
        
spawnmarker = createMarker ( 1969.9000244141, -1517.8000488281, 970.79998779297 , "cylinder",  2, 9, 30, 213, 255 ) 
  
function MarkerHit ( hitPlayer, matchingDimension ) 
    if ( hitPlayer == localPlayer ) then 
        guiSetVisible ( mainGUI, true ) 
        showCursor ( true ) 
    end 
end 
addEventHandler ( "onClientMarkerHit", spawnmarker, MarkerHit ) 
  
function pilotChange() 
    if (source == pilotButton) then 
      setElementPosition ( localPlayer,1679.3029785156,1446.3712158203,11.043098449707 ) 
        guiSetVisible ( mainGUI, false ) --hides GUI 
        showCursor ( false ) --hides cursor 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), pilotChange) 

:)

Link to comment

Tested it myself. Works perfectly.

Client-side

local spawnmarker = createMarker(1969.9000244141, -1517.8000488281, 970.79998779297, "cylinder",  2, 9, 30, 213, 255) 
  
addEventHandler("onClientMarkerHit", spawnmarker, 
    function(hitElement, matchingDimension) 
        if getElementType(hitElement) == "player" and matchingDimension then 
            if not isElement(g_window) then 
                g_window = guiCreateWindow(147, 141, 749, 548, "The Aviator Spawn Panel by Robbster", false) 
                g_memo = guiCreateMemo(80,56,627,302,'Welcome to to the Aviators Airline Gamemode!t\n\n-----\nINFO\nINFO \nINFO\nINFO\n-------\n\nHere are the ranks\n\nA student pilot is 0 points : These can fly everything except the Andromada, AT-400, military planes and military helicopters (hydra/hunter)\n\nA Private pilot is 150 points : These can fly everything except the Andromada and AT-400, and military planes and helicopters (hydra/hunter) and flying with the shamal will be x1.5 the amount of money a student pilot earns\n\nA Commercial pilot is 250 points  : These can fly everything except the military planes and helicopters (hydra/hunter)\n\nArmy pilots is 500 points : These can fly everything\nIn an airline, all airplanes of the airline can be used not matter what \"level\" you are.', false, g_window) 
                g_label = guiCreateLabel(270, 398, 94, 46, "", false, g_window) 
                g_button = guiCreateButton(280, 401, 194, 92, "Lets get to Work Pilot!", false, g_window) 
                showCursor(true) 
                
                addEventHandler("onClientGUIClick", g_button, 
                    function() 
                        setElementPosition(localPlayer, 1679.3029785156, 1446.3712158203, 11.043098449707) 
                        setCameraTarget(localPlayer) 
                        fadeCamera(true) 
                        destroyElement(g_window) 
                        showCursor(false) 
                    end 
                , false) 
            else 
                guiBringToFront(g_window) 
            end 
        end 
    end 
) 

Link to comment
Tested it myself. Works perfectly.

Client-side

local spawnmarker = createMarker(1969.9000244141, -1517.8000488281, 970.79998779297, "cylinder",  2, 9, 30, 213, 255) 
  
addEventHandler("onClientMarkerHit", spawnmarker, 
    function(hitElement, matchingDimension) 
        if getElementType(hitElement) == "player" and matchingDimension then 
            if not isElement(g_window) then 
                g_window = guiCreateWindow(147, 141, 749, 548, "The Aviator Spawn Panel by Robbster", false) 
                g_memo = guiCreateMemo(80,56,627,302,'Welcome to to the Aviators Airline Gamemode!t\n\n-----\nINFO\nINFO \nINFO\nINFO\n-------\n\nHere are the ranks\n\nA student pilot is 0 points : These can fly everything except the Andromada, AT-400, military planes and military helicopters (hydra/hunter)\n\nA Private pilot is 150 points : These can fly everything except the Andromada and AT-400, and military planes and helicopters (hydra/hunter) and flying with the shamal will be x1.5 the amount of money a student pilot earns\n\nA Commercial pilot is 250 points  : These can fly everything except the military planes and helicopters (hydra/hunter)\n\nArmy pilots is 500 points : These can fly everything\nIn an airline, all airplanes of the airline can be used not matter what \"level\" you are.', false, g_window) 
                g_label = guiCreateLabel(270, 398, 94, 46, "", false, g_window) 
                g_button = guiCreateButton(280, 401, 194, 92, "Lets get to Work Pilot!", false, g_window) 
                showCursor(true) 
                
                addEventHandler("onClientGUIClick", g_button, 
                    function() 
                        setElementPosition(localPlayer, 1679.3029785156, 1446.3712158203, 11.043098449707) 
                        setCameraTarget(localPlayer) 
                        fadeCamera(true) 
                        destroyElement(g_window) 
                        showCursor(false) 
                    end 
                , false) 
            else 
                guiBringToFront(g_window) 
            end 
        end 
    end 
) 

Trying now :D

Edit- Tested it works but when you spawn the GUI doesnt go away, Im gonna try fixing that ill tell you if it doesnt work thanks!

Edit - All working thanks!!!

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...