Jump to content

big problem pls help me :(


yoya99

Recommended Posts

hello i have this countdown resource and i want it to make a text at the players screen like playername... starts the countdown ... 3 ,2,1 GO ! or something :( thx

server:

time = {} 
    function Countdown (player, cmd) 
      if isTimer(time[player]) then return end 
        time[player] = setTimer(function() time[player] = nil end,30000,1) 
        local name = getPlayerName(player) 
        local r,g,b = getPlayerNametagColor (player) 
        local accountname = getAccountName (getPlayerAccount(player)) 
        outputChatBox ( "" .. name .. ": #FF9600 Starts the Countdown !", getRootElement(), r, g, b, true ) 
        outputChatBox ( "#FF0000 ===3===", getRootElement(), 255, 255, 255, true ) 
        triggerClientEvent("triggerclientforGridCountdown", getRootElement()) 
        setTimer ( Countdown5, 1000, 1 ) 
    end 
    function Countdown5 ( root ) 
        outputChatBox ( "#FF0000 ===2===", getRootElement(), 255, 255, 255, true ) 
        setTimer ( Countdown4, 1000, 1 ) 
    end 
    function Countdown4 ( root ) 
        outputChatBox ( "#FF0000 ===1===", getRootElement(), 255, 255, 255, true ) 
        setTimer ( Countdown3, 1000, 1 ) 
    end 
    function Countdown3 ( root ) 
        outputChatBox ( "#FF0000 Go Go Go!!!", getRootElement(), 255, 255, 255, true ) 
        setTimer ( Countdown2, 1000, 1 ) 
    end 
      
    addCommandHandler( "countdown", Countdown ) 

client:

function somethingfor() 
  
    if getTickCount() - getTickStart > 0 and count == 0 then 
        sound3 = playSound( "3.mp3", false ) 
        setSoundMaxDistance( sound3, 5000 ) 
        count = 1 
    elseif getTickCount() - getTickStart > 1000 and count == 1 then  
        if sound3 and isElement(sound3) then stopSound( sound3 ) end 
        sound2 = playSound( "2.mp3", false ) 
        setSoundMaxDistance( sound2, 5000 ) 
        count = 2 
    elseif getTickCount() - getTickStart > 2000 and count == 2 then 
        if sound2 and isElement(sound2) then stopSound( sound2 ) end 
        sound1 = playSound( "1.mp3", false ) 
        setSoundMaxDistance( sound1, 5000 ) 
        count = 3 
    elseif getTickCount() - getTickStart > 3000 and count == 3 then 
        if sound1 and isElement(sound1) then stopSound( sound1 ) end 
        sound0 = playSound( "0.mp3", false ) 
        setSoundMaxDistance( sound0, 5000 ) 
        count = 4 
    elseif getTickCount() - getTickStart > 4000 and count == 4 then 
        count = 5 
        if sound0 and isElement(sound0) then stopSound( sound0 ) end 
        removeEventHandler( "onClientRender", getRootElement(), somethingfor) 
    end 
end 
  
function GridCountdown() 
    count = 0 
    getTickStart = getTickCount () 
    addEventHandler( "onClientRender", getRootElement(), somethingfor) 
end 
addEvent ( "triggerclientforGridCountdown", true ) 
addEventHandler ( "triggerclientforGridCountdown", getRootElement(), GridCountdown ) 

Link to comment
  
sWidth, sHeight = nil, nil 
X, Y, Width, Height = nil, nil, nil, nil 
count = nil 
  
function pro() 
    if count ~= 5 then 
        dxDrawText( tostring(count), x, y, Width, Height ) 
    else 
        dxDrawText( "GO!", x, y, Width, Height ) 
    end 
end 
  
function somethingfor() 
    sWidth, sHeight = guiGetScreenSize() 
    Width,Height = 10, 10 
    X = (sWidth/2) - (Width/2) 
    Y = (sHeight/2) - (Height/2) 
    addEventHandler("onClientRender", root, pro ) 
    if getTickCount() - getTickStart > 0 and count == 0 then 
        sound3 = playSound( "3.mp3", false ) 
        setSoundMaxDistance( sound3, 5000 ) 
        count = 1 
    elseif getTickCount() - getTickStart > 1000 and count == 1 then  
        if sound3 and isElement(sound3) then stopSound( sound3 ) end 
        sound2 = playSound( "2.mp3", false ) 
        setSoundMaxDistance( sound2, 5000 ) 
        count = 2 
    elseif getTickCount() - getTickStart > 2000 and count == 2 then 
        if sound2 and isElement(sound2) then stopSound( sound2 ) end 
        sound1 = playSound( "1.mp3", false ) 
        setSoundMaxDistance( sound1, 5000 ) 
        count = 3 
    elseif getTickCount() - getTickStart > 3000 and count == 3 then 
        if sound1 and isElement(sound1) then stopSound( sound1 ) end 
        sound0 = playSound( "0.mp3", false ) 
        setSoundMaxDistance( sound0, 5000 ) 
        count = 4 
    elseif getTickCount() - getTickStart > 4000 and count == 4 then 
        count = 5 
        if sound0 and isElement(sound0) then stopSound( sound0 ) end 
        removeEventHandler( "onClientRender", getRootElement(), somethingfor) 
        setTimer(removeEventHandler, 1000, 1, "onClientRender", root, pro ) 
    end 
end 
  
  
  
function GridCountdown() 
    count = 0 
    getTickStart = getTickCount () 
    addEventHandler( "onClientRender", getRootElement(), somethingfor) 
end 
addEvent ( "triggerclientforGridCountdown", true ) 
addEventHandler ( "triggerclientforGridCountdown", getRootElement(), GridCountdown ) 
  

Link to comment
  
  
sWidth, sHeight = nil, nil 
X, Y, Width, Height = nil, nil, nil, nil 
count = nil 
  
function pro() 
    if count ~= 5 then 
        dxDrawText( tostring(count), X, Y, Width, Height ) 
    else 
        dxDrawText( "GO!", X, Y, Width, Height ) 
    end 
end 
  
function somethingfor() 
    sWidth, sHeight = guiGetScreenSize() 
    Width,Height = 10, 10 
    X = (sWidth/2) - (Width/2) 
    Y = (sHeight/2) - (Height/2) 
    addEventHandler("onClientRender", root, pro ) 
    if getTickCount() - getTickStart > 0 and count == 0 then 
        sound3 = playSound( "3.mp3", false ) 
        setSoundMaxDistance( sound3, 5000 ) 
        count = 1 
    elseif getTickCount() - getTickStart > 1000 and count == 1 then 
        if sound3 and isElement(sound3) then stopSound( sound3 ) end 
        sound2 = playSound( "2.mp3", false ) 
        setSoundMaxDistance( sound2, 5000 ) 
        count = 2 
    elseif getTickCount() - getTickStart > 2000 and count == 2 then 
        if sound2 and isElement(sound2) then stopSound( sound2 ) end 
        sound1 = playSound( "1.mp3", false ) 
        setSoundMaxDistance( sound1, 5000 ) 
        count = 3 
    elseif getTickCount() - getTickStart > 3000 and count == 3 then 
        if sound1 and isElement(sound1) then stopSound( sound1 ) end 
        sound0 = playSound( "0.mp3", false ) 
        setSoundMaxDistance( sound0, 5000 ) 
        count = 4 
    elseif getTickCount() - getTickStart > 4000 and count == 4 then 
        count = 5 
        if sound0 and isElement(sound0) then stopSound( sound0 ) end 
        removeEventHandler( "onClientRender", getRootElement(), somethingfor) 
        setTimer(removeEventHandler, 1000, 1, "onClientRender", root, pro ) 
    end 
end 
  
  
  
function GridCountdown() 
    count = 0 
    getTickStart = getTickCount () 
    addEventHandler( "onClientRender", getRootElement(), somethingfor) 
end 
addEvent ( "triggerclientforGridCountdown", true ) 
addEventHandler ( "triggerclientforGridCountdown", getRootElement(), GridCountdown ) 
  
  

Link to comment
  
  
  
sWidth, sHeight = nil, nil 
X, Y, Width, Height = nil, nil, nil, nil 
count = nil 
  
function pro() 
    if count ~= 4 then 
        dxDrawText( tostring(count), X, Y, Width, Height ) 
    else 
        dxDrawText( "GO!", X, Y, Width, Height ) 
    end 
end 
  
function somethingfor() 
    sWidth, sHeight = guiGetScreenSize() 
    Width,Height = 10, 10 
    X = (sWidth/2) - (Width/2) 
    Y = (sHeight/2) - (Height/2) 
    addEventHandler("onClientRender", root, pro ) 
    if getTickCount() - getTickStart > 0 and count == 0 then 
        sound3 = playSound( "3.mp3", false ) 
        setSoundMaxDistance( sound3, 5000 ) 
        count = 1 
    elseif getTickCount() - getTickStart > 1000 and count == 1 then 
        if sound3 and isElement(sound3) then stopSound( sound3 ) end 
        sound2 = playSound( "2.mp3", false ) 
        setSoundMaxDistance( sound2, 5000 ) 
        count = 2 
    elseif getTickCount() - getTickStart > 2000 and count == 2 then 
        if sound2 and isElement(sound2) then stopSound( sound2 ) end 
        sound1 = playSound( "1.mp3", false ) 
        setSoundMaxDistance( sound1, 5000 ) 
        count = 3 
    elseif getTickCount() - getTickStart > 3000 and count == 3 then 
        if sound1 and isElement(sound1) then stopSound( sound1 ) end 
        sound0 = playSound( "0.mp3", false ) 
        setSoundMaxDistance( sound0, 5000 ) 
        count = 4 
    elseif getTickCount() - getTickStart > 4000 and count == 4 then 
        count = 5 
        if sound0 and isElement(sound0) then stopSound( sound0 ) end 
        removeEventHandler( "onClientRender", getRootElement(), somethingfor) 
        setTimer(removeEventHandler, 1000, 1, "onClientRender", root, pro ) 
    end 
end 
  
  
  
function GridCountdown() 
    count = 0 
    getTickStart = getTickCount () 
    addEventHandler( "onClientRender", getRootElement(), somethingfor) 
end 
addEvent ( "triggerclientforGridCountdown", true ) 
addEventHandler ( "triggerclientforGridCountdown", getRootElement(), GridCountdown ) 
  
  

Link to comment

alright now i only have 2 questions....

tha code here is woking but i want it in bankgothic on top of the screen and bigger and the GO! doesnt disappear,,,,,,

  
sWidth, sHeight = nil, nil 
X, Y, Width, Height = nil, nil, nil, nil 
count = nil 
  
function pro() 
    if count ~= 4 then 
        dxDrawText( tostring(count), X, Y, Width, Height ) 
    else 
        dxDrawText( "GO!", X, Y, Width, Height ) 
    end 
end 
  
function somethingfor() 
    sWidth, sHeight = guiGetScreenSize() 
    Width,Height = 10, 10 
    X = (sWidth/2) - (Width/2) 
    Y = (sHeight/2) - (Height/2) 
    addEventHandler("onClientRender", root, pro ) 
    if getTickCount() - getTickStart > 0 and count == 0 then 
        sound3 = playSound( "3.mp3", false ) 
        setSoundMaxDistance( sound3, 5000 ) 
        count = 3 
    elseif getTickCount() - getTickStart > 1000 and count == 3 then 
        if sound3 and isElement(sound3) then stopSound( sound3 ) end 
        sound2 = playSound( "2.mp3", false ) 
        setSoundMaxDistance( sound2, 5000 ) 
        count = 2 
    elseif getTickCount() - getTickStart > 2000 and count == 2 then 
        if sound2 and isElement(sound2) then stopSound( sound2 ) end 
        sound1 = playSound( "1.mp3", false ) 
        setSoundMaxDistance( sound1, 5000 ) 
        count = 1 
    elseif getTickCount() - getTickStart > 3000 and count == 1 then 
        if sound1 and isElement(sound1) then stopSound( sound1 ) end 
        sound0 = playSound( "0.mp3", false ) 
        setSoundMaxDistance( sound0, 5000 ) 
        count = 4 
    end 
end 
  
  
  
function GridCountdown() 
    count = 0 
    getTickStart = getTickCount () 
    addEventHandler( "onClientRender", getRootElement(), somethingfor) 
end 
addEvent ( "triggerclientforGridCountdown", true ) 
addEventHandler ( "triggerclientforGridCountdown", getRootElement(), GridCountdown ) 
  
  

Link to comment
  
  
sWidth, sHeight = nil, nil 
X, Y, Width, Height = nil, nil, nil, nil 
count = nil 
  
function pro() 
    if count ~= 4 then 
        dxDrawText( tostring(count), X, Y, Width, Height, tocolor(255, 255, 255, 255), 1, "bankgothic" ) 
    else 
        dxDrawText( "GO!", X, Y, Width, Height, tocolor(255, 255, 255, 255), 1, "bankgothic" ) 
    end 
end 
  
function somethingfor() 
    sWidth, sHeight = guiGetScreenSize() 
    Width,Height = 50, 50 
    X = (sWidth/2) - (Width/2) 
    Y = (sHeight/2) - (Height/2) 
    addEventHandler("onClientRender", root, pro ) 
    if getTickCount() - getTickStart > 0 and count == 0 then 
        sound3 = playSound( "3.mp3", false ) 
        setSoundMaxDistance( sound3, 5000 ) 
        count = 3 
    elseif getTickCount() - getTickStart > 1000 and count == 3 then 
        if sound3 and isElement(sound3) then stopSound( sound3 ) end 
        sound2 = playSound( "2.mp3", false ) 
        setSoundMaxDistance( sound2, 5000 ) 
        count = 2 
    elseif getTickCount() - getTickStart > 2000 and count == 2 then 
        if sound2 and isElement(sound2) then stopSound( sound2 ) end 
        sound1 = playSound( "1.mp3", false ) 
        setSoundMaxDistance( sound1, 5000 ) 
        count = 1 
    elseif getTickCount() - getTickStart > 3000 and count == 1 then 
        if sound1 and isElement(sound1) then stopSound( sound1 ) end 
        sound0 = playSound( "0.mp3", false ) 
        setSoundMaxDistance( sound0, 5000 ) 
        count = 4 
        removeEventHandler("onClientRender", root, pro ) 
    end 
end 
  
  
  
function GridCountdown() 
    count = 0 
    getTickStart = getTickCount () 
    addEventHandler( "onClientRender", getRootElement(), somethingfor) 
end 
addEvent ( "triggerclientforGridCountdown", true ) 
addEventHandler ( "triggerclientforGridCountdown", getRootElement(), GridCountdown ) 
  
  

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