Tokio

[HELP] Why not working dx animation?

Recommended Posts

local start = getTickCount() 
local one, one1 = -300, 604
local two, two1 = 0, 604
local screenW, screenH = guiGetScreenSize()
local text = ""
local pic = "j"
 
function draw()
    local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") 
    local now = getTickCount() 
    dxDrawRectangle(x,y, screenW * 0.2306, screenH * 0.0356, tocolor(0, 0, 0, 130), false) 
    dxDrawText(" * "..text, x, y, screenW * 0.2340, screenH * 0.7044, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, true, false)
end

addEventHandler("onClientPlayerChangeNick", root, function(oldName, newName)
addEventHandler("onClientRender", root,draw)
  text = string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. oldName .. " #FFffFFneve mostantól " .. string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. newName .. ""
  pic = "c"
	setTimer ( function()
			removeEventHandler("onClientRender", root, draw)
	end, 5000, 1 )
end
)

this is my code. the dx things are working, just the animation does not working :S how to fix? :S 

 

sorry for my very bad english :C

Share this post


Link to post
local start = getTickCount() 
local one, one1 = -300, 604
local two, two1 = 0, 604
local screenW, screenH = guiGetScreenSize()
local text = ""
local pic = "j"
 
function draw()
local now = getTickCount() 
local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") 
dxDrawRectangle(x,y, screenW * 0.2306, screenH * 0.0356, tocolor(0, 0, 0, 130), false) 
dxDrawText(" * "..text, x, y, screenW * 0.2340, screenH * 0.7044, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, true, false)
end

addEventHandler("onClientPlayerChangeNick", root, function(oldName, newName)
	start = getTickCount()
addEventHandler("onClientRender", root,draw)
  text = string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. oldName .. " #FFffFFneve mostantól " .. string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. newName .. ""
  pic = "c"
	setTimer ( function()
			removeEventHandler("onClientRender", root, draw)
	end, 5000, 1 )
end
)

 

  • Thanks 1

Share this post


Link to post
2 minutes ago, Default#^ said:

local start = getTickCount() 
local one, one1 = -300, 604
local two, two1 = 0, 604
local screenW, screenH = guiGetScreenSize()
local text = ""
local pic = "j"
 
function draw()
local now = getTickCount() 
local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") 
dxDrawRectangle(x,y, screenW * 0.2306, screenH * 0.0356, tocolor(0, 0, 0, 130), false) 
dxDrawText(" * "..text, x, y, screenW * 0.2340, screenH * 0.7044, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, true, false)
end

addEventHandler("onClientPlayerChangeNick", root, function(oldName, newName)
	start = getTickCount()
addEventHandler("onClientRender", root,draw)
  text = string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. oldName .. " #FFffFFneve mostantól " .. string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. newName .. ""
  pic = "c"
	setTimer ( function()
			removeEventHandler("onClientRender", root, draw)
	end, 5000, 1 )
end
)

 

thank you!! :D

Share this post


Link to post

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.