-
Notifications
You must be signed in to change notification settings - Fork 0
/
cl.lua
33 lines (29 loc) · 954 Bytes
/
cl.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local running = false
local baseX = 0.5
local baseY = 0.8
local baseWidth = 0.27
local baseHeight = 0.03
function StartProgBar(label, time)
if not running then
local startTime = GetGameTimer()
running = true
local remaring = time
while remaring > 0 do
Wait(0)
remaring = time - (GetGameTimer() - startTime)
DrawRect(baseX, baseY, baseWidth + 0.006, baseHeight + 0.006, 0, 0, 0, 100)
DrawRect(baseX, baseY, baseWidth * ( remaring / time ), baseHeight, 0, 129, 186, 255)
SetTextFont(4)
SetTextScale(0.5, 0.5)
SetTextColour(255, 255, 255, 255)
SetTextCentre(1)
SetTextEntry("STRING")
AddTextComponentString(label)
DrawText( baseX, baseY - 0.015 )
end
running = false
end
end
RegisterCommand('progtest', function()
StartProgBar('Test..', 5000) --time in ms
end)