function timer (oyuncu, cmd, paraMiktari)
if not tonumber(paraMiktari) then
outputChatBox("Wrong usage!", oyuncu, 255, 0, 0,true)
return end
oyuncuCek = {}
for _,g in ipairs(getElementsByType("player")) do
table.insert(oyuncuCek, getPlayerName(g))
end
randomCek = math.random(1, #oyuncuCek)
kazanan = oyuncuCek[randomCek]
outputChatBox("[INFO] #ffffffGiveaway event starting in 5 seconds for #00ff00$"..paraMiktari.." #ffffffby "..getPlayerName(oyuncu).."", root, 255, 125, 0,true)
setTimer ( function()
outputChatBox("[INFO] #ffffff5", root, 255, 125, 0,true)
end, 1000, 1 )
setTimer ( function()
outputChatBox("[INFO] #ffffff4", root, 255, 125, 0,true)
end, 2000, 1 )
setTimer ( function()
outputChatBox("[INFO] #ffffff3", root, 255, 125, 0,true)
end, 3000, 1 )
setTimer ( function()
outputChatBox("[INFO] #ffffff2", root, 255, 125, 0,true)
end, 4000, 1 )
setTimer ( function()
outputChatBox("[INFO] #ffffff1", root, 255, 125, 0,true)
end, 5000, 1 )
setTimer ( function()
outputChatBox("[INFO] #990033Winner is: #ffffff"..kazanan.."" , root, 255, 125, 0,true)
end, 6000, 1 )
givePlayerMoney(getPlayerFromName(kazanan), paraMiktari)
oyuncuCek = {}
end
addCommandHandler("giveaway", timer)