Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- More Information @ http://www.nextgenupdate.com/forums/showthread.php?t=732031&p=5795129
- class Offsets
- {
- public static uint
- G_HudElems = 0x15DDB00,
- G_MaterialIndex = 0x276020,
- }
- public class ObjStruct
- {
- public static uint
- ObjectiveIndex = 0x1608194,
- ObjectiveIndexLength = 0x30,
- Origin = 0x04,
- X = 0x04,
- Y = 0x08,
- Z = 0x0C,
- targetEntNum = 0x10,
- MaterialIndex = 0x1C,
- State = 0x28,
- Team = 0x2D;
- }
- 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;
- }
- private static uint HudElem_Alloc()
- {
- for (uint i = 120; i < 1024; i++)
- {
- uint Index = Offsets.G_HudElems + (i * HudStruct.HudsLength);
- if (Lib.ReadByte(Index + HudStruct.type) == 0)
- {
- Lib.WriteBytes(Index, new byte[0x88]);
- return Index;
- }
- }
- return 0;
- }
- private static uint Objective_Alloc()
- {
- for (uint i = 3; i <= 31; i++)
- {
- uint Index = ObjStruct.ObjectiveIndex + (i * ObjStruct.ObjectiveIndexLength);
- if (Lib.ReadInt32(Index) == 0)
- {
- Lib.WriteBytes(Index, new byte[0x30]);
- return Index;
- }
- }
- return 0;
- }
- public static void Huds_DestroyAll()
- {
- for (uint i = 60; i < 0x400; i++)
- {
- PS3.SetMemory(Offsets.G_HudElems + (i * HudStruct.HudsLength), new byte[HudStruct.HudsLength]);
- }
- }
- public static void Objective_DestroyAll()
- {
- for (uint i = 3; i <= 31; i++)
- {
- uint Index = ObjStruct.ObjectiveIndex + (i * ObjStruct.ObjectiveIndexLength);
- Lib.WriteBytes(Index, new byte[ObjStruct.ObjectiveIndexLength]);
- }
- }
- public static int getMaterialIndex(string Material)
- {
- return (int)RPC.Call(Offsets.G_MaterialIndex, Material);
- }
- public static void SetObjective(Int16 onEntity = 0x3FF, Object Material = null, Single[] Position = null)
- {
- UInt32 Objective = Objective_Alloc();
- Lib.WriteInt32(Objective, 1);
- Lib.WriteSingle(Objective + ObjStruct.Origin, Position);
- Lib.WriteInt16(Objective + ObjStruct.targetEntNum, onEntity);
- if (Material is String)
- { Lib.WriteInt32(Objective + ObjStruct.MaterialIndex, (Int16)getMaterialIndex((String)Material)); }
- if (Material is Int32)
- { Lib.WriteInt32(Objective + ObjStruct.MaterialIndex, (Int32)Material); }
- }
- public static uint SetWaypoint(Int32 clientIndex = 0x3FF, Int16 onEntity = 0x3FF, Object Material = null, Single[] Position = null, Int32 R = 255, Int32 G = 255, Int32 B = 255, Int32 A = 255)
- {
- uint Waypoint = HudElem_Alloc();
- Lib.WriteByte(Waypoint + HudStruct.type, 0xF);//0xF = Waypoint
- if (Material is String)
- { Lib.WriteByte(Waypoint + HudStruct.offscreenMaterialIndex, Convert.ToByte(getMaterialIndex((String)Material))); }
- if (Material is Int32)
- { Lib.WriteByte(Waypoint + HudStruct.offscreenMaterialIndex, Convert.ToByte(Material)); }
- Lib.WriteSingle(Waypoint, Position);
- Lib.WriteInt32(Waypoint + HudStruct.clientOffset, clientIndex);
- Lib.WriteInt16(Waypoint + HudStruct.targetEntNum, onEntity);
- Lib.WriteByte(Waypoint + HudStruct.ui3dWindow, 0xFF);
- Lib.WriteBytes(Waypoint + HudStruct.color, new Byte[] { (Byte)R, (Byte)G, (Byte)B, (Byte)A });
- return Waypoint;
- }
Add Comment
Please, Sign In to add comment