Jump to content

[Solved]


#RooTs

Recommended Posts

  
local startTime = 0 
local rootElement = getRootElement() 
local totalTime = 5000 
  
function createText() 
  
    local aux = getTickCount() - startTime 
  
    dxDrawText("Text",x,y, etc... ) 
  
    if aux > totalTime then 
        removeEventHandler("onClientRender", rootElement, createText) 
    end 
end 
  
function ShowText() 
    startTime = getTickCount() 
    addEventHandler("onClientRender", rootElement, createText) 
    end 
addEventHandler("onClientResourceStart", rootElement, ShowText) 
  
  

Try this

Link to comment

Edit the coordinates, try putting a little more to the left

I had tested with those coordinates before, and everything works perfectly.

  
    sx,sy = guiGetScreenSize() 
    px,py = 1600,900 
    x,y =  (sx/px), (sy/py) 
    dxDrawText("Your Text Here",x*280, y*400, x*1320, y*120, tocolor(255, 255, 255, 255), 2, "bankgothic" ) 
  

Link to comment
  
local startTime = 0 
local rootElement = getResourceRootElement(getThisResource()) 
local totalTime = 5000 
local sx,sy = guiGetScreenSize() 
local px,py = 1600,900 
local x,y =  (sx/px), (sy/py) 
local RR = math.random(100, 255) 
local BB = math.random(100, 255) 
local GG = math.random(100, 255) 
  
function createText() 
    local aux = getTickCount() - startTime 
  
dxDrawText("Your Text Here",x*280, y*400, x*1320, y*120, tocolor(RR, BB, GG, 255), 2, "bankgothic" ) 
  
    if aux > totalTime then 
        removeEventHandler("onClientRender", root, createText) 
    end 
end 
  
function ShowText() 
    startTime = getTickCount() 
    addEventHandler("onClientRender", root, createText) 
    end 
addEventHandler("onClientResourceStart", rootElement, ShowText) 
  

Link to comment
-- Client Side # 
local DonText = "Your Text" 
  
function DonEVENT(  ) 
  dxDrawText(DonText, 100, 100, 100, 100, tocolor(255, 255, 255,255), 1, "default-bold") 
end 
addEventHandler("onClientRender", root,DonEVENT) 
  
setTimer( function( ) 
removeEventHandler("onClientRender", root, DonEVENT) 
end, 20000, 1, true) 

Link to comment

It's very rude to remove your posts like that. Next time don't post the snippets of your code if you're too afraid that they will get stolen. These forums are here to help you and other people. So if you like to help other people then do not delete your posts next times.

Edited by Guest
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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