Jump to content

[help] guicreatelabel resolution


Chaos

Recommended Posts

I created an example

Right Bottom for all resolutions

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
local screenW, screenH = guiGetScreenSize() 
        Example = guiCreateLabel(screenW - 578 - 10, (screenH - 91) - 20, 578, 91, "EXAMPLE", false) 
        guiSetFont(Example, "sa-gothic")     
    end 
) 

Link to comment

can i replace this guilabel to dxdrawtext ?

function clientsetupstarter(startedresource) 
    if startedresource == getThisResource() then 
        setTimer ( clientsetup, 1234, 1) 
        MainClientTimer1 = setTimer ( zombie_check, 1000, 0)  --STARTS THE TIMER TO CHECK FOR ZOMBIES 
        ----this expLabel = guiCreateLabel(0.668,0.85,0.3000,5,"EXP gained: ??\nTotal EXP: ??\nLevel: Unknown",true) -- Start EXP and level system 
        guiLabelSetColor(expLabel,255,0,0) 
        guiLabelSetVerticalAlign(expLabel,"top") 
        guiLabelSetHorizontalAlign(expLabel,"right",false) 
  
  
    end 
end 
  
local ttlgnd = 0 
function expChange(expr,gained) 
    ttlgnd = ttlgnd+gained 
    guiSetText(expLabel,"") 
    local level,levelnum = "#0-Beginner",0 
    if expr >= 30 then level = "#1-Average" levelnum = 1 end 
    if expr >= 70 then level = "#2-Good" levelnum = 2 end 
    if expr >= 100 then level = "#3-Killer" levelnum = 3 end 
    if expr >= 249 then level = "#4-Assassin" levelnum = 4 end 
    if expr >= 600 then level = "#5-Blooder" levelnum = 5 end 
    if expr >= 1499 then level = "#6-Skilled" levelnum = 6 end 
    if expr >= 1999 then level = "#7-Elite" levelnum = 7 end 
    if expr >= 2999 then level = "#8-Senior" levelnum = 8 end 
    if expr >= 3999 then level = "#9-Amazing" levelnum = 9 end 
    if expr >= 4999 then level = "#10-Predator" levelnum = 10 end 
    if expr >= 5999 then level = "#11-ZombieKiller" levelnum = 11 end 
    if expr >= 6999 then level = "#12-Hacker" levelnum = 12 end 
    if expr >= 7999 then level = "#13-Psychopath" levelnum = 13 end 
    if expr >= 8999 then level = "#14-Professional" levelnum = 14 end 
    if expr >= 9999 then level = "#15-Godlike" levelnum = 15 end 
    if expr >= 10000000 then level = "#16-God" levelnum = 16 end 
     
     
    guiSetText(expLabel,"EXP gained: "..ttlgnd.." (+"..gained..")\nTotal EXP: "..expr.."\nLevel: "..level) 
    setElementData(getLocalPlayer(),"Level",level) 
    setElementData(getLocalPlayer(),"levelnum",levelnum) 
    end 
     
addEvent( "expOnChange", true ) 
addEventHandler( "expOnChange", getRootElement(), expChange ) 
addEventHandler("onClientResourceStart", getRootElement(), clientsetupstarter) 

Link to comment
can i replace this guilabel to dxdrawtext ?
function clientsetupstarter(startedresource) 
    if startedresource == getThisResource() then 
        setTimer ( clientsetup, 1234, 1) 
        MainClientTimer1 = setTimer ( zombie_check, 1000, 0)  --STARTS THE TIMER TO CHECK FOR ZOMBIES 
        ----this expLabel = guiCreateLabel(0.668,0.85,0.3000,5,"EXP gained: ??\nTotal EXP: ??\nLevel: Unknown",true) -- Start EXP and level system 
        guiLabelSetColor(expLabel,255,0,0) 
        guiLabelSetVerticalAlign(expLabel,"top") 
        guiLabelSetHorizontalAlign(expLabel,"right",false) 
  
  
    end 
end 
  
local ttlgnd = 0 
function expChange(expr,gained) 
    ttlgnd = ttlgnd+gained 
    guiSetText(expLabel,"") 
    local level,levelnum = "#0-Beginner",0 
    if expr >= 30 then level = "#1-Average" levelnum = 1 end 
    if expr >= 70 then level = "#2-Good" levelnum = 2 end 
    if expr >= 100 then level = "#3-Killer" levelnum = 3 end 
    if expr >= 249 then level = "#4-Assassin" levelnum = 4 end 
    if expr >= 600 then level = "#5-Blooder" levelnum = 5 end 
    if expr >= 1499 then level = "#6-Skilled" levelnum = 6 end 
    if expr >= 1999 then level = "#7-Elite" levelnum = 7 end 
    if expr >= 2999 then level = "#8-Senior" levelnum = 8 end 
    if expr >= 3999 then level = "#9-Amazing" levelnum = 9 end 
    if expr >= 4999 then level = "#10-Predator" levelnum = 10 end 
    if expr >= 5999 then level = "#11-ZombieKiller" levelnum = 11 end 
    if expr >= 6999 then level = "#12-Hacker" levelnum = 12 end 
    if expr >= 7999 then level = "#13-Psychopath" levelnum = 13 end 
    if expr >= 8999 then level = "#14-Professional" levelnum = 14 end 
    if expr >= 9999 then level = "#15-Godlike" levelnum = 15 end 
    if expr >= 10000000 then level = "#16-God" levelnum = 16 end 
     
     
    guiSetText(expLabel,"EXP gained: "..ttlgnd.." (+"..gained..")\nTotal EXP: "..expr.."\nLevel: "..level) 
    setElementData(getLocalPlayer(),"Level",level) 
    setElementData(getLocalPlayer(),"levelnum",levelnum) 
    end 
     
addEvent( "expOnChange", true ) 
addEventHandler( "expOnChange", getRootElement(), expChange ) 
addEventHandler("onClientResourceStart", getRootElement(), clientsetupstarter) 

You can't use a similar " guiSetText" Function to the dxTexts. (Doesn't exist)

You need to change a lot of things.

Link to comment

you mean like this?

GUIEditor = { 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(0.78, 0.82, 0.21, 0.18, "", true) 
    expLabel = guiCreateLabel(0.668,0.85,0.30,5,"EXP gained: ??\nTotal EXP: ??\nLevel: Unknown",true) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 0.00)     
    end 
) 

Link to comment
you mean like this?
GUIEditor = { 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(0.78, 0.82, 0.21, 0.18, "", true) 
    expLabel = guiCreateLabel(0.668,0.85,0.30,5,"EXP gained: ??\nTotal EXP: ??\nLevel: Unknown",true) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 0.00)     
    end 
) 

yeah but use the ScreenH and ScreenW.

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