Jump to content

[HELP] guiSetVisible


Recommended Posts

Lionel, normally you can Add an event handler and remove it to the function with dxDrawText, but you can also use a command to set a global variable, and then make the dxDraw constant but only On if the variable is true.

Alright. can you show me an example for that?

and this is the drawText which i want to make unvisible when player login.

addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
    end 
) 

Link to comment

no need to use guiSetVisible on dxDrawText

  
function showdx() 
    if getElementData(localPlayer, "Dx.showing") then 
     dxDrawText(...) 
    end 
end 
addEventHandler("onClientRender", root, showdx) 
  
function showDXdraw(player) 
    if getElementData(localPlayer, "Dx.showing") then 
    setElementData(localPlayer, "Dx.showing", false) 
    else 
    setElementData(localPlayer, "Dx.showing", true) 
    end 
end 
bindKey("F7", "down", showDXdraw) 

Link to comment
no need to use guiSetVisible on dxDrawText
  
function showdx() 
    if getElementData(localPlayer, "Dx.showing") then 
     dxDrawText(...) 
    end 
end 
addEventHandler("onClientRender", root, showdx) 
  
function showDXdraw(player) 
    if getElementData(localPlayer, "Dx.showing") then 
    setElementData(localPlayer, "Dx.showing", false) 
    else 
    setElementData(localPlayer, "Dx.showing", true) 
    end 
end 
bindKey("F7", "down", showDXdraw) 

Really Nice..Helped Much..but i want to make the DXText be hidden when the player Login..not with bindkey...:)

Link to comment
So?

Actually now i did it.

    function showdx() 
        if getElementData(localPlayer, "Dx.showing") then 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        end 
    end 
  
      
    function showDXdraw(player) 
        if getElementData(localPlayer, "Dx.showing") then 
        setElementData(localPlayer, "Dx.showing", false) 
        else 
        setElementData(localPlayer, "Dx.showing", true) 
        end 
    end 
    addEvent("onClientPlayerJoin",true) 
    addEventHandler("onClientPlayerLogin", root, showDXdraw) 

server:

function login ( source ) 
triggerClientEvent("onClientPlayerLogin",source) 
end 
addEvent("onPlayerLogin",true) 
addEventHandler("onPlayerLogin",getRootElement(),login) 

But Still not work :/..someone help!

Link to comment

Ehm.. those triggers dont need to be server side... try this:

  
   function showdx() 
        if getElementData(localPlayer, "Dx.showing") then 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        end 
    end 
  
      
    function showDXdraw() 
    if not On then 
    addEventHandler("OnClientRender", getRootElement(), showdx) 
    setTimer(StopDxDraw, 10000, 1) -- stop the draw 
    else 
    On = true 
        addEventHandler("OnClientRender", getRootElement(), showdx) 
        setTimer(StopDxDraw, 10000, 1) -- Stop the draw 
        end 
    end 
    addEventHandler("onPlayerLogin", getRootElement(), showDXdraw) 
     
    function StopDxDraw() 
    if On then 
    On = false 
    removeEventHandler("onClientRender", getRootElement(), showdx) 
    else 
    On = false 
    removeEventHandler("onClientRender", getRootElement(), showdx) 
    end 
  

Link to comment
Ehm.. those triggers dont need to be server side... try this:
  
   function showdx() 
        if getElementData(localPlayer, "Dx.showing") then 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 73, 982, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 323, 71, 982, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 73, 980, 120, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 321, 71, 980, 118, tocolor(0, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawText("\"\"ZOMBIES\"\" Are Waiting For YOU!", 322, 72, 981, 119, tocolor(255, 0, 0, 255), 3.00, "sans", "left", "top", false, false, true, false, false) 
        dxDrawImage(239, -1, 83, 122, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(961, 0, 82, 120, ":Login_SystemNEW/Images/Zombie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 1, 1, 1280, 73, tocolor(0, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawText("WELCOME TO THE END OF THE WORLD", 0, 0, 1279, 72, tocolor(255, 0, 0, 255), 2.00, "sans", "center", "center", false, false, true, false, false) 
        dxDrawLine(238, 123, 1043, 123, tocolor(0, 0, 0, 255), 7, true) 
        end 
    end 
  
      
    function showDXdraw() 
    if not On then 
    addEventHandler("OnClientRender", getRootElement(), showdx) 
    setTimer(StopDxDraw, 10000, 1) -- stop the draw 
    else 
    On = true 
        addEventHandler("OnClientRender", getRootElement(), showdx) 
        setTimer(StopDxDraw, 10000, 1) -- Stop the draw 
        end 
    end 
    addEventHandler("onPlayerLogin", getRootElement(), showDXdraw) 
     
    function StopDxDraw() 
    if On then 
    On = false 
    removeEventHandler("onClientRender", getRootElement(), showdx) 
    else 
    On = false 
    removeEventHandler("onClientRender", getRootElement(), showdx) 
    end 
  

Good..but Lol! When i'm just Join the Draw Text be removed...means not visible...or removed...not like when the player login..it's when the player join

Link to comment
Its triggered on Login Atm, you can set it to join, And you can also change the timmer, i did 10secs.

Oh and btw, that will only work on your resolution, try using guiGetScreenSize() and a multiplier/divider.

The Problem not with the Draw only! when i add the script which you puted on my own client side..it Hide everything....not Only DRAW Text!!..:/

Link to comment
Its triggered on Login Atm, you can set it to join, And you can also change the timmer, i did 10secs.

Oh and btw, that will only work on your resolution, try using guiGetScreenSize() and a multiplier/divider.

The Problem not with the Draw only! when i add the script which you puted on my own client side..it Hide everything....not Only DRAW Text!!..:/

Hows that? which other thing u got?

Link to comment
Its triggered on Login Atm, you can set it to join, And you can also change the timmer, i did 10secs.

Oh and btw, that will only work on your resolution, try using guiGetScreenSize() and a multiplier/divider.

The Problem not with the Draw only! when i add the script which you puted on my own client side..it Hide everything....not Only DRAW Text!!..:/

Hows that? which other thing u got?

I got Tab Panel for Login and Register...and this Draw Text for show in join only...in Login..i want to hide the Draw...but this script make everything hidden on join.

Link to comment
Its triggered on Login Atm, you can set it to join, And you can also change the timmer, i did 10secs.

Oh and btw, that will only work on your resolution, try using guiGetScreenSize() and a multiplier/divider.

The Problem not with the Draw only! when i add the script which you puted on my own client side..it Hide everything....not Only DRAW Text!!..:/

Hows that? which other thing u got?

Hows that? which other thing u got?

I got Tab Panel for Login and Register...and this Draw Text for show in join only...in Login..i want to hide the Draw...but this script make everything hidden on join.

Alright found the problem of it...that script wanted "end" to work..anyway the draw texts not be hidden when player login.... :/ there's no another way to hide them?

Link to comment
Its triggered on Login Atm, you can set it to join, And you can also change the timmer, i did 10secs.

Oh and btw, that will only work on your resolution, try using guiGetScreenSize() and a multiplier/divider.

Meant about that...This script's not Changing ANYTHING!.

I wont do it for you.. do some work on your on, this aint a place for people making stuff for you.

Link to comment
Its triggered on Login Atm, you can set it to join, And you can also change the timmer, i did 10secs.

Oh and btw, that will only work on your resolution, try using guiGetScreenSize() and a multiplier/divider.

Meant about that...This script's not Changing ANYTHING!.

I wont do it for you.. do some work on your on, this aint a place for people making stuff for you.

Fixed it...Thank you anyway.

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