Jump to content

Question


WASSIm.

Recommended Posts

Posted

Don't put it in the event?

for example:

local window = guiCreateWindow(...) 
  
addEventHandler("onClientRender",getRootElement(), 
function() 
guiSetVisible(window,false) -- or whatever  
end 
) 

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted
Don't put it in the event?

for example:

local window = guiCreateWindow(...) 
  
addEventHandler("onClientRender",getRootElement(), 
function() 
guiSetVisible(window,false) -- or whatever  
end 
) 

i need windows in onClientRender but if make it its create again

addEventHandler("onClientRender",getRootElement(), 
function() 
window = guiCreateWindow(...) 
end 
) 

Omerta Roleplay

Posted
addEventHandler( "onClientRnder", root, 
    function( ) 
        if window then 
            return 
        end 
        window = guiCreateWindow( ... ) 
    end 
) 

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted
addEventHandler( "onClientRnder", root, 
    function( ) 
        if window then 
            return 
        end 
        window = guiCreateWindow( ... ) 
    end 
) 

now windows not working and if make local nothing change

Omerta Roleplay

Posted
Post whole code!
function main ( ) 
    start = getTickCount() 
    addEventHandler ("onClientRender",  root, move) 
end 
bindKey ("F2","down", main) 
  
function move ( )  
        local x = 0.5 
        local y = 0.5 
        local w = 0.6 
        local h = 0.6 
        local now = getTickCount() 
        local elapsedTime = now - start 
        local endtime = start + 1000 
        local duration = endtime - start 
        local progress = elapsedTime / duration 
        local w1, h1, z = interpolateBetween ( 0, 0, 0, w, h, 0, progress, "OutInBounce") 
        x1 = x-(w1/2) 
        y1 = y-(h1/2) 
        local dxgui = guidxCreateWindow(x1,y1,w1, h1,"SHOP PANEL",70) 
end 

Omerta Roleplay

Posted

it is :?:

guidxCreateWindow 

........... \__ ▄▂_

.........[█|||███████]▄▄▄▄▄▄▄▄▄▃▂

..__▂▄▅█████████▅▄▃▂

I███████████████████]

...◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤

░░░███████ ]▄▄▄▄▄▄▄▄

▂▄▅████████▅▄▃▂

I███████████████████]

◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤

Posted

That should be enough:

function main ( ) 
    start = getTickCount() 
    addEventHandler ("onClientRender",  root, move) 
end 
bindKey ("F2","down", main) 
  
function move ( ) 
        if not dxgui then 
        local x = 0.5 
        local y = 0.5 
        local w = 0.6 
        local h = 0.6 
        local now = getTickCount() 
        local elapsedTime = now - start 
        local endtime = start + 1000 
        local duration = endtime - start 
        local progress = elapsedTime / duration 
        local w1, h1, z = interpolateBetween ( 0, 0, 0, w, h, 0, progress, "OutInBounce") 
        x1 = x-(w1/2) 
        y1 = y-(h1/2) 
        local dxgui = guidxCreateWindow(x1,y1,w1, h1,"SHOP PANEL",70) 
        end 
end 

bruh

Posted
  
function guidxCreateWindow(x,y,w,h,text,alpha)  
    local sx,sy = guiGetScreenSize ( ) 
    local win = guiCreateStaticImage( sx*x,sy*y,sx*w,sy*h, "black.png", false) 
    local wx, wy = guiGetSize ( win, false ) 
    guiSetProperty( win, "Alpha", alpha) 
    local winup = guiCreateStaticImage( 0,0,1,0.1, "winup.jpg", true, win ) 
    local text = guiCreateLabel(0,0,1, 1,text,true, winup) 
    guiSetProperty( text, "Alpha", 300) 
    guiLabelSetHorizontalAlign(text, "center") 
    guiLabelSetVerticalAlign(text, "center") 
    guiSetFont ( text, guiCreateFont( "font.ttf", 30 ) ) 
    return win 
end 
  
  
function main ( ) 
    start = getTickCount() 
    addEventHandler ("onClientRender",  root, pingstate) 
end 
bindKey ("F2","down", main) 
  
function pingstate ( )  
        if not dxgui then 
        local x = 0.5 
        local y = 0.5 
        local w = 0.6 
        local h = 0.6 
         
        local now = getTickCount() 
        local elapsedTime = now - start 
        local endtime = start + 1000 
        local duration = endtime - start 
        local progress = elapsedTime / duration 
        local w1, h1, z = interpolateBetween ( 0, 0, 0, w, h, 0, progress, "OutInBounce") 
         
        x1 = x-(w1/2) 
        y1 = y-(h1/2) 
        local dxgui = guidxCreateWindow(x1,y1,w1, h1,"SHOP PANEL",70) 
        end 
end 
  

Omerta Roleplay

Posted
local dxgui = guidxCreateWindow(x1,y1,w1, h1,"SHOP PANEL",70) 

Remove the 'local' infront of it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

What do you mean?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

it isn't working because you are creating the image every frame, use variables instead with

guiSetPosition 

and

guiSetSize 

Sometimes I dream about cheese

Posted

Thanks :D

its working in first time and now i changed something and now not moving and panel working

function guidxCreateWindow(x,y,w,h,text)  
    win = guiCreateStaticImage( x,y,w,h, "black.png", false) 
    local wx, wy = guiGetSize ( win, false ) 
    guiSetProperty( win, "Alpha", 70) 
    local winup = guiCreateStaticImage( 0,0,1,0.1, "winup.jpg", true, win ) 
    local text = guiCreateLabel(0,0,1, 1,text,true, winup) 
    guiSetProperty( text, "Alpha", 300) 
    guiLabelSetHorizontalAlign(text, "center") 
    guiLabelSetVerticalAlign(text, "center") 
    guiSetFont ( text, guiCreateFont( "font.ttf", 30 ) ) 
    return win 
end 
  
     
function main ( )  
    if ( guiGetVisible ( win ) == true ) then 
        start = getTickCount() 
        addEventHandler ("onClientRender",  root, move) 
    else             
        removeEventHandler ("onClientRender",  root, move) 
    end 
end 
addEventHandler ("onClientResourceStart",  root, main) 
  
function move ( )  
    local x, y = guiGetPosition ( win, false ) 
    local w, h = guiGetSize ( win, false ) 
    local now = getTickCount() 
    local elapsedTime = now - start 
    local endtime = start + 1000 
    local duration = endtime - start 
    local progress = elapsedTime / duration 
    local w1, h1, z = interpolateBetween ( 0, 0, 0, w, h, 0, progress, "Linear") 
    local x1 = x-(w1/2) 
    local y1 = y-(h1/2) 
    guiSetPosition ( win, x1, y1, false) 
    guiSetSize ( win, w1, h1, false) 
end 
  
--------------------------------------------------TEST------------------------------------------- 
local sx,sy = guiGetScreenSize ( ) 
local dxgui = guidxCreateWindow( sx*0.5, sy*0.5, sx*0.6, sy*0.6,"TEST PANEL") 
guiSetVisible ( dxgui, false ) 
  
function test ( )  
    if ( guiGetVisible ( dxgui ) == false ) then 
        guiSetVisible ( dxgui, true ) 
    else             
        guiSetVisible ( dxgui, false ) 
    end 
end 
bindKey ("F2","down", test) 
  

Omerta Roleplay

Posted
function guidxCreateWindow(x,y,w,h,text) 
    local win = guiCreateStaticImage( x,y,w,h, "black.png", false) 
    local wx, wy = guiGetSize ( win, false ) 
    guiSetProperty( win, "Alpha", 70) 
    local winup = guiCreateStaticImage( 0,0,1,0.1, "winup.jpg", true, win ) 
    local text = guiCreateLabel(0,0,1, 1,text,true, winup) 
    guiSetProperty( text, "Alpha", 300) 
    guiLabelSetHorizontalAlign(text, "center") 
    guiLabelSetVerticalAlign(text, "center") 
    guiSetFont ( text, guiCreateFont( "font.ttf", 30 ) ) 
    return win 
end 
  
--------------------------------------------------TEST------------------------------------------- 
local sx,sy = guiGetScreenSize ( ) 
local dxgui = guidxCreateWindow( sx*0.5, sy*0.5, sx*0.6, sy*0.6,"TEST PANEL") 
guiSetVisible ( dxgui, false ) 
  
function move ( ) 
    local x, y = guiGetPosition ( dxgui, false ) 
    local w, h = guiGetSize ( dxgui, false ) 
    local now = getTickCount() 
    local elapsedTime = now - start 
    local endtime = start + 1000 
    local duration = endtime - start 
    local progress = elapsedTime / duration 
    local w1, h1, z = interpolateBetween ( 0, 0, 0, w, h, 0, progress, "Linear") 
    local x1 = x-(w1/2) 
    local y1 = y-(h1/2) 
    guiSetPosition ( dxgui, x1, y1, false) 
    guiSetSize ( dxgui, w1, h1, false) 
end 
  
function test ( ) 
    if ( guiGetVisible ( dxgui ) == false ) then 
        guiSetVisible ( dxgui, true ) 
        start = getTickCount() 
        addEventHandler ("onClientRender",  root, move) 
    else             
        guiSetVisible ( dxgui, false ) 
        removeEventHandler ("onClientRender",  root, move) 
    end 
end 
bindKey ("F2","down", test) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

no no no i dont want that

i make this because i want all ( guidxCreateWindow ) moving

function main ( ) 
    if ( guiGetVisible ( win ) == true ) then 
        start = getTickCount() 
        addEventHandler ("onClientRender",  root, move) 
    else             
        removeEventHandler ("onClientRender",  root, move) 
    end 
end 
addEventHandler ("onClientResourceStart",  root, main) 

Omerta Roleplay

Posted

You must make a different script then.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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