Jump to content

[REL] Countdown system | - WAR OF EMPIRE -|


laserlaser

Recommended Posts

Hello,i'm write a new resource.This name is Countdown!!

The Codes :

  
countDown=0 
countDownSecond=0 
function countDownX() 
    local display 
    --for k,v in ipairs(getElementsByType("player")) do 
        --textDisplayAddObserver ( display, getRootElement() ) 
    --end 
    --[[if tonumber(countDownSecond)>=1 then 
        local text = textCreateTextItem ( tostring(countDownSecond), 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) 
        textDisplayAddText ( display, text ) 
        setTimer ( textDisplayRemoveText, 500, 1, display, text ) 
        countDownSecond=countDownSecond-1 
    else 
        local text = textCreateTextItem ( "GO GO GO!!", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) 
        textDisplayAddText ( display, text ) 
        setTimer ( textDisplayRemoveText, 500, 1, display, text ) 
        countDown=0 
        countDownSecond=0 
    end]] 
    if tonumber(countDownSecond) ~=0 then 
        for k,v in ipairs( getElementsByType("player") ) do 
            display = textCreateDisplay()                           -- create a text display 
            textDisplayAddObserver ( display, v )              -- make it visible to a player 
            myTextItem = textCreateTextItem ( tostring(countDownSecond), 0.5, 0.5,"medium",255,255,255,150,6.0 )    -- create a text item for the display 
            textDisplayAddText ( display, myTextItem )    
            setTimer ( textDisplayRemoveText, 500, 1, display, myTextItem ) 
  
        end  
        countDownSecond=countDownSecond-1 
    else 
        for k,v in ipairs( getElementsByType("player") ) do 
            display = textCreateDisplay()                           -- create a text display 
            textDisplayAddObserver ( display, v )              -- make it visible to a player 
            myTextItem = textCreateTextItem ( "GO! GO! GO!", 0.2, 0.5,"medium",0,255,0,130,7.3 )    -- create a text item for the display 
            textDisplayAddText ( display, myTextItem )    
            setTimer ( textDisplayRemoveText, 1000, 1, display, myTextItem ) 
            countDownSecond=0 
            countDown=0 
  
        end  
    end 
    --[[if countDownSecond ~= 0 then 
        outputChatBox(countDownSecond,getRootElement(),255,0,0,true) 
        countDownSecond=countDownSecond-1 
    else 
        outputChatBox("GO GO GO!!",getRootElement(),0,255,0,true) 
        countDownSecond=0 
        countDown=0 
    end]] 
         
     
end 
  
function cmdCountDown(player,cmd,countRecord) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then  
        if countDown==1 then 
            outputChatBox("Zaten bir sayım işlemi sürüyor...",player,255,0,0,true) 
        else 
            if tonumber(countRecord) > 10 or tonumber(countRecord)<1 then 
                outputChatBox("Record süresi 10 ve 1 arasında olmalıdır...",player,255,0,0,true) 
            else 
             
                setTimer(countDownX,1000,countRecord+1) 
                countDown=1 
                countDownSecond=countRecord 
             
            end 
        end 
    end 
end 
addCommandHandler("countdown",cmdCountDown) 
  

The commands use admins :)

/countdown record ( 1-10)

--

Made in TURKEY!

War Of Empire LUA TEAM

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