Jump to content

Help , in Code Dx , {FreeRoam}


LoOs

Recommended Posts

Hello ,

I have encountered a problem when creating freeroam dx

When you press a button to open the panel open with no problems

But when you press the close button closes the grid list

But dx does not close

Please note that I used removeEventHandler

Code: #

local button = getControl ( wndMain, "شخصيات" ) 
    guiSetAlpha ( button, 0.0 ) 
    local button2 = getControl ( wndMain, "إنتحار" ) 
    guiSetAlpha ( button2, 0.0 ) 
    local button3 = getControl ( wndMain, "حركات" ) 
    guiSetAlpha ( button3, 0.0 ) 
    local button4 = getControl ( wndMain, "ملابس" ) 
    guiSetAlpha ( button4, 0.0 ) 
    local button5 = getControl ( wndMain, "أدوات" ) 
    guiSetAlpha ( button5, 0.0 ) 
    local button6 = getControl ( wndMain, "إنتقال" ) 
    guiSetAlpha ( button6, 0.0 ) 
    local button7 = getControl ( wndMain, "حفظ المكان" ) 
    guiSetAlpha ( button7, 0.0 ) 
    local button8 = getControl ( wndMain, "playergrav" ) 
    guiSetAlpha ( button8, 0.0 ) 
    local button9 = getControl ( wndMain, "الحالة" ) 
    guiSetAlpha ( button9, 0.0 ) 
    local button10 = getControl ( wndMain, "setpos" ) 
    guiSetAlpha ( button10, 0.0 ) 
    local button11 = getControl ( wndMain, "createvehicle" ) 
    guiSetAlpha ( button11, 0.0 ) 
    local button12 = getControl ( wndMain, "تعديلات" ) 
    guiSetAlpha ( button12, 0.0 ) 
    local button13 = getControl ( wndMain, "setinterior" ) 
    guiSetAlpha ( button13, 0.0 ) 
    local button14 = getControl ( wndMain, "ألوان" ) 
    guiSetAlpha ( button14, 0.0 ) 
    local button15 = getControl ( wndMain, "إصلاح" ) 
    guiSetAlpha ( button15, 0.0 ) 
    local button16 = getControl ( wndMain, "إنقلاب" ) 
    guiSetAlpha ( button16, 0.0 ) 
    local button17 = getControl ( wndMain, "الهاك" ) 
    guiSetAlpha ( button17, 0.0 ) 
     
    local set = getControl ( wndSkin, "set" ) 
    guiSetAlpha ( set, 0.0 ) 
     
    local c = getControl ( wndSkin, "close" ) 
    guiSetAlpha ( c, 0.0 ) 
     
     
        addEventHandler("onClientClick",root, 
    function () 
    if ( c ) then 
                removeEventHandler("onClientRender",getRootElement(),Skin) 
                end 
            end 
        ) 
    addEventHandler("onClientClick",root,    
        function () 
    if ( button ) then 
                addEventHandler("onClientRender",root,Skin) 
    end 
    end 
    ) 

and , Thanks

Link to comment
  • Moderators

Try this instead:

local button = getControl ( wndMain, "شخصيات" ) 
guiSetAlpha ( button, 0.0 ) 
local button2 = getControl ( wndMain, "إنتحار" ) 
guiSetAlpha ( button2, 0.0 ) 
local button3 = getControl ( wndMain, "حركات" ) 
guiSetAlpha ( button3, 0.0 ) 
local button4 = getControl ( wndMain, "ملابس" ) 
guiSetAlpha ( button4, 0.0 ) 
local button5 = getControl ( wndMain, "أدوات" ) 
guiSetAlpha ( button5, 0.0 ) 
local button6 = getControl ( wndMain, "إنتقال" ) 
guiSetAlpha ( button6, 0.0 ) 
local button7 = getControl ( wndMain, "حفظ المكان" ) 
guiSetAlpha ( button7, 0.0 ) 
local button8 = getControl ( wndMain, "playergrav" ) 
guiSetAlpha ( button8, 0.0 ) 
local button9 = getControl ( wndMain, "الحالة" ) 
guiSetAlpha ( button9, 0.0 ) 
local button10 = getControl ( wndMain, "setpos" ) 
guiSetAlpha ( button10, 0.0 ) 
local button11 = getControl ( wndMain, "createvehicle" ) 
guiSetAlpha ( button11, 0.0 ) 
local button12 = getControl ( wndMain, "تعديلات" ) 
guiSetAlpha ( button12, 0.0 ) 
local button13 = getControl ( wndMain, "setinterior" ) 
guiSetAlpha ( button13, 0.0 ) 
local button14 = getControl ( wndMain, "ألوان" ) 
guiSetAlpha ( button14, 0.0 ) 
local button15 = getControl ( wndMain, "إصلاح" ) 
guiSetAlpha ( button15, 0.0 ) 
local button16 = getControl ( wndMain, "إنقلاب" ) 
guiSetAlpha ( button16, 0.0 ) 
local button17 = getControl ( wndMain, "الهاك" ) 
guiSetAlpha ( button17, 0.0 ) 
  
local setBtn = getControl ( wndSkin, "set" ) 
guiSetAlpha ( setBtn, 0.0 ) 
  
local c = getControl ( wndSkin, "close" ) 
guiSetAlpha ( c, 0.0 ) 
  
  
addEventHandler("onClientGUIClick", c, function () 
    removeEventHandler("onClientRender", root, Skin) 
end, false) 
  
addEventHandler("onClientGUIClick", button, function () 
    addEventHandler("onClientRender", root, Skin) 
end, false) 

As you are using GUI buttons, I used the event onClientGUIClick on the 'button' and 'c' buttons (note that I'm not using 'root' so only that buttons will call the functions so no need to do an extra if statement inside anymore).

Also ! I renamed 'set' button variable as 'setBtn' because set is already a name of an existing function: set

Try this and see if it works.

Best regards,

Citizen

Link to comment
Try this instead:
local button = getControl ( wndMain, "شخصيات" ) 
guiSetAlpha ( button, 0.0 ) 
local button2 = getControl ( wndMain, "إنتحار" ) 
guiSetAlpha ( button2, 0.0 ) 
local button3 = getControl ( wndMain, "حركات" ) 
guiSetAlpha ( button3, 0.0 ) 
local button4 = getControl ( wndMain, "ملابس" ) 
guiSetAlpha ( button4, 0.0 ) 
local button5 = getControl ( wndMain, "أدوات" ) 
guiSetAlpha ( button5, 0.0 ) 
local button6 = getControl ( wndMain, "إنتقال" ) 
guiSetAlpha ( button6, 0.0 ) 
local button7 = getControl ( wndMain, "حفظ المكان" ) 
guiSetAlpha ( button7, 0.0 ) 
local button8 = getControl ( wndMain, "playergrav" ) 
guiSetAlpha ( button8, 0.0 ) 
local button9 = getControl ( wndMain, "الحالة" ) 
guiSetAlpha ( button9, 0.0 ) 
local button10 = getControl ( wndMain, "setpos" ) 
guiSetAlpha ( button10, 0.0 ) 
local button11 = getControl ( wndMain, "createvehicle" ) 
guiSetAlpha ( button11, 0.0 ) 
local button12 = getControl ( wndMain, "تعديلات" ) 
guiSetAlpha ( button12, 0.0 ) 
local button13 = getControl ( wndMain, "setinterior" ) 
guiSetAlpha ( button13, 0.0 ) 
local button14 = getControl ( wndMain, "ألوان" ) 
guiSetAlpha ( button14, 0.0 ) 
local button15 = getControl ( wndMain, "إصلاح" ) 
guiSetAlpha ( button15, 0.0 ) 
local button16 = getControl ( wndMain, "إنقلاب" ) 
guiSetAlpha ( button16, 0.0 ) 
local button17 = getControl ( wndMain, "الهاك" ) 
guiSetAlpha ( button17, 0.0 ) 
  
local setBtn = getControl ( wndSkin, "set" ) 
guiSetAlpha ( setBtn, 0.0 ) 
  
local c = getControl ( wndSkin, "close" ) 
guiSetAlpha ( c, 0.0 ) 
  
  
addEventHandler("onClientGUIClick", c, function () 
    removeEventHandler("onClientRender", root, Skin) 
end, false) 
  
addEventHandler("onClientGUIClick", button, function () 
    addEventHandler("onClientRender", root, Skin) 
end, false) 

As you are using GUI buttons, I used the event onClientGUIClick on the 'button' and 'c' buttons (note that I'm not using 'root' so only that buttons will call the functions so no need to do an extra if statement inside anymore).

Also ! I renamed 'set' button variable as 'setBtn' because set is already a name of an existing function: set

Try this and see if it works.

Best regards,

Citizen

Code works #

Thank You # :D

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