Jump to content

GUI Problem


KITT1995

Recommended Posts

I made this code:

function enableGUI () 
  if getPedOccupiedVehicle(source) == false then 
   outputChatBox ("You're not in a vehicle") 
  else 
    if guiGetVisible(GUI_Window[1]) == false then 
        guiSetVisible(GUI_Window[1], true) 
        showCursor(true) 
    else 
        guiSetVisible(GUI_Window[1], false) 
        showCursor(false) 
    end 
  end 
end 
bindKey ("1", "down", enableGUI ) 

When i'm not in a car and I press 1 i get that message in chatbox, but when I'm in a car and I press 1 i get that message again and the GUI doesn't appear. Can someone help me? thanks

Link to comment
function enableGUI () 
  if getPedOccupiedVehicle(getLocalPlayer( )) == false then 
   outputChatBox ("You're not in a vehicle") 
  else 
    if guiGetVisible(GUI_Window[1]) == false then 
        guiSetVisible(GUI_Window[1], true) 
        showCursor(true) 
    else 
        guiSetVisible(GUI_Window[1], false) 
        showCursor(false) 
    end 
  end 
end 
bindKey ("1", "down", enableGUI ) 

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