Jump to content

Buggy Script Help


.:HyPeX:.

Recommended Posts

Well, its a bit buggy, sometimes images get struck, get under other ones, etc, and im unsure why, can someone help me out?

  
  
function RenderBaseDashBoard() 
local x,y = guiGetScreenSize() 
dxDrawRectangle(0, 0, x*0.2, y, tocolor(100,100,100,255)) 
local i = "Image"..1 
dxDrawImage(Dashboard.Positions.ImageNow[i][1] * x, Dashboard.Positions.ImageNow[i][2] * y, Dashboard.Positions.ImageNow[i][3] * x, Dashboard.Positions.ImageNow[i][4] * y, Dashboard.Positions.ImageNow[i][5],0,0,0, tocolor(255,255,255,255), true) 
local i = "Image"..2 
dxDrawImage(Dashboard.Positions.ImageNow[i][1] * x, Dashboard.Positions.ImageNow[i][2] * y, Dashboard.Positions.ImageNow[i][3] * x, Dashboard.Positions.ImageNow[i][4] * y, Dashboard.Positions.ImageNow[i][5],0,0,0, tocolor(255,255,255,255), true) 
local i = "Image"..3 
dxDrawImage(Dashboard.Positions.ImageNow[i][1] * x, Dashboard.Positions.ImageNow[i][2] * y, Dashboard.Positions.ImageNow[i][3] * x, Dashboard.Positions.ImageNow[i][4] * y, Dashboard.Positions.ImageNow[i][5],0,0,0, tocolor(255,255,255,255), true) 
local i = "Image"..4 
dxDrawImage(Dashboard.Positions.ImageNow[i][1] * x, Dashboard.Positions.ImageNow[i][2] * y, Dashboard.Positions.ImageNow[i][3] * x, Dashboard.Positions.ImageNow[i][4] * y, Dashboard.Positions.ImageNow[i][5],0,0,0, tocolor(255,255,255,255), true) 
  
for i=1, 4 do 
local a = "Text"..i 
dxDrawText(Dashboard.Positions.Text[a][1] , Dashboard.Positions.Text[a][2] * x, Dashboard.Positions.Text[a][3] * y, Dashboard.Positions.Text[a][4] * x, Dashboard.Positions.Text[a][5] * y, tocolor(255,255,255,255),3,"clear","left", "top", true, false,true, true, true, 270, x*0.05 + (x*0.2 * i), y*0.85)   
end 
  
end 
addEventHandler("onClientRender", getRootElement(), RenderBaseDashBoard) 
  
  
MyStart = {} 
Timers = {} 
Timer = {} 
function MoveImagePosition(image,xstart,xend) 
MyStart[image] = getTickCount() 
local image,xstart,xend = image, xstart,xend 
Timers[image] = setTimer(function () 
ClientRenderMoving(image, xstart, xend) 
end, 50,0) 
Timer[image] = setTimer(function() 
Timers[image] = nil 
Timer[image] = nil 
end, 1000, 1) 
  
end 
  
function ClientRenderMoving(image,startx, endx) 
local start = MyStart[image] 
local image = tonumber(image) 
local startx = tonumber(startx) 
local endx = tonumber(endx) 
local now = getTickCount() 
if now - start < 1000 then 
local endtime = start + 1000 
local elapsed = now - start 
local duration = endtime - start 
local progress = elapsed / duration 
local nimage = "Image"..image 
for c=1, 4 do 
Dashboard.Positions.ImageNow[nimage][c] = interpolateBetween(Dashboard.Positions.ImageStart[nimage][startx][c], 0,0, Dashboard.Positions.ImageStart[nimage][endx][c],0,0, progress, "Linear") 
end 
end 
end 
  
function CheckMyShit(cmd, image, startx, endx) 
MoveImagePosition(image, startx,endx) 
end 
addCommandHandler("tta", CheckMyShit) 
  

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