Jump to content

[Help]Open panel by mark


raynner

Recommended Posts

hello good I was doing a simple panel for use in Some events, he is quite ready however wish he abrise by mark could someone please fix the min to function? thank you.

SpawnveicleRcLr01 = createMarker(-2147, -738, 31, "cylinder", 1.5, 255, 0, 0, 153) 
setElementDimension(SpawnveicleRcLr01, 110) 
  
        RACELRWINDS = guiCreateWindow(498, 289, 267, 158, "PAINEL RACE LOS RED", false) 
        guiWindowSetSizable(RACELRWINDS, false) 
        guiSetProperty(RACELRWINDS, "CaptionColour", "FF1700FC") 
        guiSetVisible(RACELRWINDS, false) 
  
        MyFont = guiCreateFont("Arquivos/s3d.ttf", 9) 
        Img = guiCreateStaticImage(0, 20, 266, 134, "Arquivos/LogoRED.png", false, RACELRWINDS) 
        ProImg = guiCreateLabel(0, 20, 266, 134, "", false, RACELRWINDS) 
         
        CAR1 = guiCreateButton(10, 30, 110, 32, "Carro 1", false, RACELRWINDS) 
        guiSetFont(CAR1, MyFont) 
        guiSetProperty(CAR1, "NormalTextColour", "FF2AFE00") 
         
        CAR2 = guiCreateButton(148, 30, 107, 32, "Carro 2", false, RACELRWINDS) 
        guiSetFont(CAR2, MyFont) 
        guiSetProperty(CAR2, "NormalTextColour", "FF2AFE00") 
         
        DESTROY = guiCreateButton(10, 88, 110, 32, "destroir carro", false, RACELRWINDS) 
        guiSetFont(DESTROY, MyFont) 
        guiSetProperty(DESTROY, "NormalTextColour", "FFFCF420") 
         
        BIND = guiCreateButton(148, 88, 108, 32, "Bind F1 B", false, RACELRWINDS) 
        guiSetFont(BIND, MyFont) 
        guiSetProperty(BIND, "NormalTextColour", "FFFCF420") 
         
        EXIT = guiCreateButton(47, 127, 175, 21, "Fechar", false, RACELRWINDS) 
        guiSetFont(EXIT, MyFont) 
        guiSetProperty(EXIT, "NormalTextColour", "FFFD0000") 
        GUIEditor.label[1] = guiCreateLabel(0, 20, 266, 134, "", false, RACELRWINDS) 
  
function visiblyLrRc () 
  if guiGetVisible(RACELRWINDS) then 
    guiSetVisible(RACELRWINDS, false) 
    showCursor(false) 
  else 
    guiSetVisible(RACELRWINDS, true) 
    showCursor(true) 
  end 
end 
addEventHandler( "onMarkerHit", SpawnveicleRcLr01, visiblyLrRc ) 

Link to comment

Try This ?

SpawnveicleRcLr01 = createMarker(-2147, -738, 31, "cylinder", 1.5, 255, 0, 0, 153) 
setElementDimension(SpawnveicleRcLr01, 110) 
  
        RACELRWINDS = guiCreateWindow(498, 289, 267, 158, "PAINEL RACE LOS RED", false) 
        guiWindowSetSizable(RACELRWINDS, false) 
        guiSetProperty(RACELRWINDS, "CaptionColour", "FF1700FC") 
        guiSetVisible(RACELRWINDS, false) 
  
        MyFont = guiCreateFont("Arquivos/s3d.ttf", 9) 
        Img = guiCreateStaticImage(0, 20, 266, 134, "Arquivos/LogoRED.png", false, RACELRWINDS) 
        ProImg = guiCreateLabel(0, 20, 266, 134, "", false, RACELRWINDS) 
        
        CAR1 = guiCreateButton(10, 30, 110, 32, "Carro 1", false, RACELRWINDS) 
        guiSetFont(CAR1, MyFont) 
        guiSetProperty(CAR1, "NormalTextColour", "FF2AFE00") 
        
        CAR2 = guiCreateButton(148, 30, 107, 32, "Carro 2", false, RACELRWINDS) 
        guiSetFont(CAR2, MyFont) 
        guiSetProperty(CAR2, "NormalTextColour", "FF2AFE00") 
        
        DESTROY = guiCreateButton(10, 88, 110, 32, "destroir carro", false, RACELRWINDS) 
        guiSetFont(DESTROY, MyFont) 
        guiSetProperty(DESTROY, "NormalTextColour", "FFFCF420") 
        
        BIND = guiCreateButton(148, 88, 108, 32, "Bind F1 B", false, RACELRWINDS) 
        guiSetFont(BIND, MyFont) 
        guiSetProperty(BIND, "NormalTextColour", "FFFCF420") 
        
        EXIT = guiCreateButton(47, 127, 175, 21, "Fechar", false, RACELRWINDS) 
        guiSetFont(EXIT, MyFont) 
        guiSetProperty(EXIT, "NormalTextColour", "FFFD0000") 
        GUIEditor.label[1] = guiCreateLabel(0, 20, 266, 134, "", false, RACELRWINDS) 
  
addEventHandler ( "onClientMarkerHit", resourceRoot, function ( hitElement ) 
if ( source == SpawnveicleRcLr01 ) 
if ( hitElement == localPlayer ) then 
guiSetVisible ( RACELRWINDS, not guiGetVisible ( RACELRWINDS ) ) 
showCursor ( guiGetVisible ( RACELRWINDS ) ) 
  end 
 end 
end ) 
Link to comment

why ? JUST it change.

guiSetVisible ( RACELRWINDS, not guiGetVisible ( RACELRWINDS ) )

showCursor ( guiGetVisible ( RACELRWINDS ) )

addEventHandler ( "onClientMarkerHit", root,  
function (hitElement) 
if source == SpawnveicleRcLr01 
if hitElement == localPlayer then 
guiSetVisible(RACELRWINDS, true) 
showCursor(true) 
  end 
 end 
end) 
addEventHandler ( "onClientMarkerLeave", root,  
function (hitElement) 
if source == SpawnveicleRcLr01 
if hitElement == localPlayer then 
guiSetVisible(RACELRWINDS, false) 
showCursor(false) 
  end 
 end 
end) 

Link to comment

fixed it code

   addEventHandler ( "onClientMarkerHit", root, 
    function (hitElement) 
    if source == SpawnveicleRcLr01 then 
    if hitElement == localPlayer then 
    guiSetVisible(RACELRWINDS, true) 
    showCursor(true) 
      end 
     end 
    end) 
    addEventHandler ( "onClientMarkerLeave", root, 
    function (hitElement) 
    if source == SpawnveicleRcLr01 then 
    if hitElement == localPlayer then 
    guiSetVisible(RACELRWINDS, false) 
    showCursor(false) 
      end 
     end 
    end) 

Link to comment

what do you mean ? working the gui.

swMJHtE.jpg

  SpawnveicleRcLr01 = createMarker(-2147, -738, 31, "cylinder", 1.5, 255, 0, 0, 153) 
  
  
  
   addEventHandler ( "onClientResourceStart", root, 
   function() 
        RACELRWINDS = guiCreateWindow(498, 289, 267, 158, "PAINEL RACE LOS RED", false) 
        guiWindowSetSizable(RACELRWINDS, false) 
        guiSetProperty(RACELRWINDS, "CaptionColour", "FF1700FC") 
        guiSetVisible(RACELRWINDS, false) 
end) 
  
   addEventHandler ( "onClientMarkerHit", root, 
    function (hitElement) 
    if source == SpawnveicleRcLr01 then 
    if hitElement == localPlayer then 
    guiSetVisible(RACELRWINDS, true) 
    showCursor(true) 
      end 
     end 
    end) 
    addEventHandler ( "onClientMarkerLeave", root, 
    function (hitElement) 
    if source == SpawnveicleRcLr01 then 
    if hitElement == localPlayer then 
    guiSetVisible(RACELRWINDS, false) 
    showCursor(false) 
      end 
     end 
    end) 

Link to comment
what do you mean ? working the gui.

swMJHtE.jpg

  SpawnveicleRcLr01 = createMarker(-2147, -738, 31, "cylinder", 1.5, 255, 0, 0, 153) 
  
  
  
   addEventHandler ( "onClientResourceStart", root, 
   function() 
        RACELRWINDS = guiCreateWindow(498, 289, 267, 158, "PAINEL RACE LOS RED", false) 
        guiWindowSetSizable(RACELRWINDS, false) 
        guiSetProperty(RACELRWINDS, "CaptionColour", "FF1700FC") 
        guiSetVisible(RACELRWINDS, false) 
end) 
  
   addEventHandler ( "onClientMarkerHit", root, 
    function (hitElement) 
    if source == SpawnveicleRcLr01 then 
    if hitElement == localPlayer then 
    guiSetVisible(RACELRWINDS, true) 
    showCursor(true) 
      end 
     end 
    end) 
    addEventHandler ( "onClientMarkerLeave", root, 
    function (hitElement) 
    if source == SpawnveicleRcLr01 then 
    if hitElement == localPlayer then 
    guiSetVisible(RACELRWINDS, false) 
    showCursor(false) 
      end 
     end 
    end) 

yes it worked thank you brother <3

Link to comment

Hes Code When Any Resource Start Will Make The GUI And Make It Visible

Try This ? :

SpawnveicleRcLr01 = createMarker(-2147, -738, 31, "cylinder", 1.5, 255, 0, 0, 153) 
  
  
  
addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) 
RACELRWINDS = guiCreateWindow(498, 289, 267, 158, "PAINEL RACE LOS RED", false) 
guiWindowSetSizable(RACELRWINDS, false) 
guiSetProperty(RACELRWINDS, "CaptionColour", "FF1700FC") 
guiSetVisible(RACELRWINDS, false) 
end ) 
  
  
function OpPane ( hitElement ) 
 if ( ( source == SpawnveicleRcLr01 ) and ( hitElement == localPlayer ) ) then 
  if ( eventName == "onClientMarkerHit" ) then 
   guiSetVisible ( RACELRWINDS, true ) 
  showCursor ( true ) 
 else 
  guiSetVisible ( RACELRWINDS, false ) 
   showCursor ( false ) 
 end 
end ) 
     
     
addEventHandler ( "onClientMarkerHit", resourceRoot, OpPane ) 
addEventHandler ( "onClientMarkerLeave", resourceRoot, OpPane ) 
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...