!
public class HudStruct
{
public static uint
ElemIndex = Offsets.G_HudElems,
HudsLength = 0x88,
X = 0x00,
Y = 0x04,
Z = 0x08,
FontSize = 0xC,
fromFontScale = 0x10,
fontScaleStartTime = 0x14,
color = 0x18,
fromColor = 0x1C,
fadeStartTime = 0x20,
scaleStartTime = 0x24,
fromX = 0x28,
fromY = 0x2C,
moveStartTime = 0x30,
time = 0x34,
duration = 0x38,
value = 0x3C,
sort = 0x40,
glowColor = 0x44,
fxBirthTime = 0x48,
flags = 0x4C,
targetEntNum = 0x50,
fontScaleTime = 0x52,
fadeTime = 0x54,
label = 0x56,
Width = 0x58,
Height = 0x5A,
fromWidth = 0x5C,
fromHeight = 0x5E,
scaleTime = 0x60,
moveTime = 0x62,
text = 0x64,
fxLetterTime = 0x66,
fxDecayStartTime = 0x68,
fxDecayDuration = 0x6A,
fxRedactDecayStartTime = 0x6C,
fxRedactDecayDuration = 0x6E,
type = 0x70,
Font = 0x71,
alignOrg = 0x72,
alignScreen = 0x73,
materialIndex = 0x74,
offscreenMaterialIndex = 0x75,
fromAlignOrg = 0x76,
fromAlignScreen = 0x77,
soundID = 0x78,
ui3dWindow = 0x79,
flag2 = 0x7A,
clientOffset = 0x7C,
team = 0x80,
abilityFlag = 0x84;
}
public static UInt32 GetLevelTime()
{
public static uint
level_locals_t = 0x1608100,
LevelTime = level_locals_t + 0x798;
return Lib.ReadUInt32(LevelTime);
}
public static int SetTimer(UInt32 elemIndex, Int32 Time = 60, String Direction = "Up", Boolean Tenths = true)
{
if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Up" && !Tenths)
{ Lib.WriteByte(elemIndex + HudStruct.type, 0xA); }
if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Up" && Tenths)
{ Lib.WriteByte(elemIndex + HudStruct.type, 0xC); }
if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Down" && !Tenths)
{ Lib.WriteByte(elemIndex + HudStruct.type, 0x9); }
if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Down" && Tenths)
{ Lib.WriteByte(elemIndex + HudStruct.type, 0xB); }
if (Direction == "Up")
{ Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() - (Time * 1000)); return (Int32)GetLevelTime() - (Time * 1000); }
if (Direction == "Down")
{ Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() + (Time * 1000)); return (Int32)GetLevelTime() + (Time * 1000); }
return 0;
}
public static int SetClock(UInt32 elemIndex, Int32 Duration = 60, Int32 Time = 60, String Direction = "Up")
{
if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x1 && Direction == "Up")
{ Lib.WriteByte(elemIndex + HudStruct.type, 0xE); }
if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x1 && Direction == "Down")
{ Lib.WriteByte(elemIndex + HudStruct.type, 0xD); }
if (Direction == "Up")
{
Lib.WriteInt32(elemIndex + HudStruct.duration, Duration * 1000);
Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() - (Time * 1000));
return (Int32)GetLevelTime() - (Time * 1000);
}
if (Direction == "Down")
{
Lib.WriteInt32(elemIndex + HudStruct.duration, Duration * 1000);
Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() + (Time * 1000));
return (Int32)GetLevelTime() + (Time * 1000);
}
return 0;
}
[B]SetTimer[/B]
-----------------------
SetTimer(elemIndex, Time, Direction, Tenths);
[B]SetClock[/B]
-----------------------
SetClock(elemIndex, Duration, Time, Direction);
[B]SetTimer[/B]
----------------------
elemIndex = The element you are applying a timer to (must be a text element)
Time = The time the timer starts from (example 60 = 1 minute)
Direction = "Up" or "Down", sets the direction the timer counts.
Tenths = If true the timer will show as 00.00.00 instead of 00.00
[B]SetClock[/B]
----------------------
elemIndex = The element you are applying a timer to (must be a shader)
Time = The time the clock takes to do a full circle
Duration = The speed the clock spins at
Direction = "Up" makes the clock count up, "Down" makes the clock countdown, when it reaches 0 it stops.
More information here (https://www.zeroy.com/script/hud/setclock.htm)
//In these examples I use timers but its the same thing for clocks.
[B]Example 1[/B]
--------------------
int Time = SetTimer(elemIndex, 60, "Down", false); //Set Timer At 1 Minute Counting Down
while (true)
{
if (GetLevelTime() == Time)
{
MessageBox.Show("Timer/Clock Reached 0");
break;
}
}
[B]Example 2[/B]
--------------------
int Time = SetTimer(elemIndex, 60, "", false); //Set Timer At 1 Minute Counting Down
while (true)
{
if (GetLevelTime() == (Time + 60000))//60,000 ms = 60 seconds
{
MessageBox.Show("Timer/Clock Reached 60 Seconds");
break;
}
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.