Jump to content

Strange problem with gui visiblity?


xScatta

Recommended Posts

Hey guys my problem is that when i press 'i' the window appears but when i press 'i' again then window are supposed to disappear but it won't. It's same in the vehicle. No output in debug script 3.

function controls(cond) 
showCursor(cond) 
guiSetInputEnabled(cond) 
end 
  
  
function invShow() 
if not getPedOccupiedVehicle( localPlayer ) then 
  if guiGetVisible(window) then 
    guiSetVisible( window, false ) 
    controls(false) 
  else 
    triggerServerEvent("onClientUpdateInventory",localPlayer) 
    updatePlayerINV() 
    guiSetVisible(window,true) 
    controls(true) 
  end 
end 
if getPedOccupiedVehicle( localPlayer ) then 
  local veh = getPedOccupiedVehicle( localPlayer ) 
  if getElementData(veh,"vehinv") then 
    if guiGetVisible(windowVeh) then 
      guiSetVisible(windowVeh,false) 
      controls(false) 
    else 
      triggerServerEvent("onClientUpdateInventory",veh) 
      updateVehInv() 
      guiSetVisible( windowVeh, true ) 
    end 
  else 
    if guiGetVisible(window) then 
    guiSetVisible( window, false ) 
    controls(false) 
  else 
    triggerServerEvent("onClientUpdateInventory",localPlayer) 
    updatePlayerINV() 
    guiSetVisible(window,true) 
    controls(true) 
  end 
end 
end 
end 
  
  
bindKey("i","down",invShow) 

Edited by Guest
Link to comment
Put some debug message, to see if you actually reach the line where it changes the visibility.
"No output in debug script 3."

Put some 'outputChatBox("Test1/2/3/etc.")' messages in your script to check where it is stopping with working. Then, you can easily see what 'if' is wrong.

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