Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitorSize = {guiGetScreenSize()}
- local state = 0
- local second = 100
- local font = dxCreateFont("files/font.otf", 10)
- function meghaltal()
- state = 1
- Idozito = setTimer ( countDown, 1000, 0)
- end
- addEventHandler ( "onClientPlayerWasted", getLocalPlayer(),meghaltal )
- function countDown ()
- if second > 0 then
- second = second - 1
- elseif second <= 0 then
- outputChatBox("feléledtél!")
- end
- end
- function renderPanel()
- if (state==1) then
- setCameraMatrix(399.52261352539, 2528.8083496094, 18.146799087524, 400.41943359375, 2529.1520996094, 17.86817741394)
- dxDrawText(secondsToTimeDesc(second), monitorSize[1]/2-600/2+600/2+1, monitorSize[2]/2-416/2+30+210+1, monitorSize[1]/2-600/2+600/2+1, monitorSize[2]/2-416/2+30+210+1, tocolor(0, 0, 0, 255), 1 ,font, "center", "center")
- dxDrawText(secondsToTimeDesc(second), monitorSize[1]/2-600/2+600/2, monitorSize[2]/2-416/2+30+210, monitorSize[1]/2-600/2+600/2+1, monitorSize[2]/2-416/2+30+210, tocolor(255, 255, 255, 255), 1 ,font, "center", "center")
- else
- setCameraTarget(localPlayer)
- state=0
- end
- end
- addEventHandler("onClientRender",root,renderPanel)
- function hp()
- setElementHealth(localPlayer,0)
- end
- addCommandHandler("0", hp)
- function secondsToTimeDesc( seconds )
- if seconds then
- local results = {}
- local sec = ( seconds %60 )
- local min = math.floor ( ( seconds % 3600 ) /60 )
- local hou = math.floor ( ( seconds % 86400 ) /3600 )
- local day = math.floor ( seconds /86400 )
- if day > 0 and day < 10 then table.insert( results, day .. ( day == 1 and " day" or " days" ) )
- elseif day > 0 then table.insert( results, day .. ( day == 1 and "" or "" ) ) end
- if hou >= 1 and hou < 10 then table.insert( results, "0"..hou .. ( hou == 1 and "" or "" ) )
- elseif hou > 0 then table.insert( results, hou .. ( hou == 1 and "" or "" ) ) end
- if min >= 0 and min < 10 then table.insert( results, "0"..min .. ( min == 1 and "" or "" ) )
- elseif min > 0 then table.insert( results, min .. ( hou == 1 and "" or "" ) ) end
- if sec >= 0 and sec < 10 then table.insert( results, "0"..sec .. ( sec == 1 and "" or "" ) )
- elseif sec > 0 then table.insert( results, sec .. ( sec == 1 and "" or "" ) ) end
- return string.reverse ( table.concat ( results, " : " ):reverse():gsub(" : ", " : ", 1 ) )
- end
- return ""
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement