Jump to content

How to know when the tab switch to another?


Recommended Posts

Thanks for all! now the last dude, im making a panel, that in one part theres a tab, in that tab is the interface management the you can change colors, i put it like 3 editboxes R: G: B: And if you change it and click on set button the interface and the sample rectangle should change to the inserted color of RGB How to change color like that, i know is guiGetText and what else y should use to set the color?

Link to comment
bool dxDrawRectangle ( int startX, int startY, float width, float height [, int color = white, bool postGUI = false] ) 

You have to use the event 'onClientRender' on this codes. You are using them, good. Instead of putting in: 'tocolor(255, 255, 255, 255)' you are going to do this:

--Add a variable which represents the current color: 
local gCurrentColor = tocolor(255, 255, 255, 255) 
  
--As soon as you change the color you can do this: 
local gR, gG, gB = guiGetText(youreditboxR), guiGetText(youreditboxG), guiGetText(youreditboxB) 
gCurrentColor = tocolor(tonumber(gR), tonumber(gG), tonumber(gB), 255) 

Be sure you only can enter numbers into the editboxes, if you add something else than a number, then you get alot of errors. (You can remove everything except digits with: 'string.gsub(yourstring, "%D", "")' )

Link to comment

1. What error?

2.

function onKeyUse( element ) 
    if ( hasObjectPermissionTo ( element, "function.setServerPassword", true ) ) then 
        triggerClientEvent( element, "Show", element ) 
    end 
end 

I hope you aren't going to put backdoors in and put it online?

Link to comment
function toggleGUI() 
    if guiGetVisible(PanelAdmin) == false then 
        guiSetVisible(window,false) 
        showCursor(false) 
        removeEventHandler("onClientRender", getRootElement(), CurrentColor) 
    else 
        guiSetVisible(window,true) 
        showCursor(true) 
        addEventHandler("onClientRender", root, CurrentColor) 
    end 
end 
addEvent("Show",true) 
addEventHandler("Show",root,toggleGUI) 

Still not working

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