sharkbait263

[BO2] Set Timer/Clock

May 11th, 2014
491
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.20 KB | None | 1 0
  1. //Read More @ http://www.nextgenupdate.com/forums/showthread.php?t=732747
  2.  
  3. public class HudStruct
  4.         {
  5.             public static uint
  6.             ElemIndex = Offsets.G_HudElems,
  7.             HudsLength = 0x88,
  8.             X = 0x00,
  9.             Y = 0x04,
  10.             Z = 0x08,
  11.             FontSize = 0xC,
  12.             fromFontScale = 0x10,
  13.             fontScaleStartTime = 0x14,
  14.             color = 0x18,
  15.             fromColor = 0x1C,
  16.             fadeStartTime = 0x20,
  17.             scaleStartTime = 0x24,
  18.             fromX = 0x28,
  19.             fromY = 0x2C,
  20.             moveStartTime = 0x30,
  21.             time = 0x34,
  22.             duration = 0x38,
  23.             value = 0x3C,
  24.             sort = 0x40,
  25.             glowColor = 0x44,
  26.             fxBirthTime = 0x48,
  27.             flags = 0x4C,
  28.             targetEntNum = 0x50,
  29.             fontScaleTime = 0x52,
  30.             fadeTime = 0x54,
  31.             label = 0x56,
  32.             Width = 0x58,
  33.             Height = 0x5A,
  34.             fromWidth = 0x5C,
  35.             fromHeight = 0x5E,
  36.             scaleTime = 0x60,
  37.             moveTime = 0x62,
  38.             text = 0x64,
  39.             fxLetterTime = 0x66,
  40.             fxDecayStartTime = 0x68,
  41.             fxDecayDuration = 0x6A,
  42.             fxRedactDecayStartTime = 0x6C,
  43.             fxRedactDecayDuration = 0x6E,
  44.             type = 0x70,
  45.             Font = 0x71,
  46.             alignOrg = 0x72,
  47.             alignScreen = 0x73,
  48.             materialIndex = 0x74,
  49.             offscreenMaterialIndex = 0x75,
  50.             fromAlignOrg = 0x76,
  51.             fromAlignScreen = 0x77,
  52.             soundID = 0x78,
  53.             ui3dWindow = 0x79,
  54.             flag2 = 0x7A,
  55.             clientOffset = 0x7C,
  56.             team = 0x80,
  57.             abilityFlag = 0x84;
  58.         }
  59.  
  60. public static UInt32 GetLevelTime()
  61.         {
  62.             public static uint
  63.         level_locals_t = 0x1608100,
  64.             LevelTime = level_locals_t + 0x798;
  65.  
  66.             return Lib.ReadUInt32(LevelTime);
  67.         }
  68.  
  69. public static int SetTimer(UInt32 elemIndex, Int32 Time = 60, String Direction = "Up", Boolean Tenths = true)
  70.         {
  71.             if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Up" && !Tenths)
  72.             { Lib.WriteByte(elemIndex + HudStruct.type, 0xA); }
  73.             if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Up" && Tenths)
  74.             { Lib.WriteByte(elemIndex + HudStruct.type, 0xC); }
  75.             if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Down" && !Tenths)
  76.             { Lib.WriteByte(elemIndex + HudStruct.type, 0x9); }
  77.             if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x8 && Direction == "Down" && Tenths)
  78.             { Lib.WriteByte(elemIndex + HudStruct.type, 0xB); }
  79.  
  80.             if (Direction == "Up")
  81.             { Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() - (Time * 1000)); return (Int32)GetLevelTime() - (Time * 1000); }
  82.             if (Direction == "Down")
  83.             { Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() + (Time * 1000)); return (Int32)GetLevelTime() + (Time * 1000); }
  84.             return 0;
  85.         }
  86.  
  87.         public static int SetClock(UInt32 elemIndex, Int32 Duration = 60, Int32 Time = 60, String Direction = "Up")
  88.         {
  89.             if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x1 && Direction == "Up")
  90.             { Lib.WriteByte(elemIndex + HudStruct.type, 0xE); }
  91.             if (Lib.ReadByte(elemIndex + HudStruct.type) != 0x1 && Direction == "Down")
  92.             { Lib.WriteByte(elemIndex + HudStruct.type, 0xD); }
  93.             if (Direction == "Up")
  94.             {
  95.                 Lib.WriteInt32(elemIndex + HudStruct.duration, Duration * 1000);
  96.                 Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() - (Time * 1000));
  97.                 return (Int32)GetLevelTime() - (Time * 1000);
  98.             }
  99.             if (Direction == "Down")
  100.             {
  101.                 Lib.WriteInt32(elemIndex + HudStruct.duration, Duration * 1000);
  102.                 Lib.WriteInt32(elemIndex + HudStruct.time, (Int32)GetLevelTime() + (Time * 1000));
  103.                 return (Int32)GetLevelTime() + (Time * 1000);
  104.             }
  105.             return 0;
  106.         }
Advertisement
Add Comment
Please, Sign In to add comment