Jump to content

Duda simple


NodZen

Recommended Posts

Yo habia creado una funcion para simular un .gif, aca les dejo el codigo:

local gifs = { } 
local gifTimers = { } 
  
function dxDrawGifImage ( x, y, w, h, name, cStart, cEnd, cCurrent, iType, timerSpeed ) 
    local i = ( #gifs + 1 ) 
    gifs [ i ] = { x, y, w, h, name, cStart, cEnd, cCurrent, iType } 
    gifTimers [ i ] = setTimer ( 
        function ( )  
            gifs [ i ] [ 8 ] = ( gifs [ i ] [ 8 ] + 1 ) 
            if ( gifs [ i ][ 8 ] >= gifs [ i ] [ 7 ] ) then  
                gifs [ i ] [ 8 ] = gifs [ i ] [ 6 ]  
            end 
        end 
  
        ,timerSpeed or 150, 0 
    ) 
     
    return i 
end 
  
function dxGifDestroy ( index ) 
    gifs [ index ] = nil 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        for index, gif in ipairs ( gifs ) do 
            dxDrawImage ( gif [ 1 ], gif [ 2 ], gif [ 3 ], gif [ 4 ], "images/".. gif [ 5 ] .."".. gif [ 8 ] ..".".. gif [ 9 ] ) 
        end 
    end 
) 
  
dxDrawGifImage ( 769, 175, 193, 145, "flag_arg", 0, 3, 0, "png", 150 ) 
dxDrawGifImage ( 769, 305, 193, 145, "flag_usa", 0, 3, 0, "png", 150 ) 

Lo hice hace meses y asi rapido, asi que puede que no funcione bien :P.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...