[TU7 Release] HUD Elements for All Clients

teh1337 Feb 15, 2013

  1. teh1337

    teh1337 我是精英黑客 XPG Developer
    25/47

    Joined:
    Jan 4, 2013
    Messages:
    7
    Likes Received:
    21
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Cosmos
    Console:
    Xbox
    Hey guys, I decided to release hud elements, as I found out some of you are getting them figured out.​

    Step 1:​
    Add this to your code:​
    Code:
            public class gameAddresses
            {
                public static uint
                serverCommand = 0x82254940,
                entityBase = 0x82F03600,
                entityMultiplier = 0x280, //Entity Multiplier mp
                clientCommand = 0x82224A28,
                nameOffset = 0x3208,
                buttonsOffset = 0x31B6,
                movementOffset = 0x3420,
                playerStateOffset = 0x158, //Player State Offset From Entity mp
                initAmmo = 0x821D4A00, //Init Ammo mp
                getWeaponID = 0x82210640, //Get Weapon ID mp
                givePlayerWeapon = 0x82210BC8, //G_GivePlayerWeapon mp
                setModel = 0x8220D310, //Set Model
                locString = 0x8220C838,
                material = 0x8220C9F8,
                elem = 0x821DF9C0,
                xOffset = 0x08,
                yOffset = 0x04,
                textOffset = 0x84,
                fontOffset = 0x28,
                fontSizeOffset = 0x14,
                colorOffset = 0x34,
                relativeOffset = 0x2c,
                widthOffset = 0x48,
                heightOffset = 0x44,
                shaderOffset = 0x4C,
                alignOffset = 0x30;
    
            }
    
    How to cache an Element: (returns * address):
    Code:
                        XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, gameAddresses.elem);
                        XDRPCArgumentInfo<int> client = new XDRPCArgumentInfo<int>(0);
                        XDRPCArgumentInfo<int> team = new XDRPCArgumentInfo<int>(0);
                        uint elemAddr = xbCon.ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { client, team });
    
    How to set an element on a specific player:
    Code:
    public uint spawnElem(int player, uint elemAddress)
            {
                    SetMem(ReverseBytes(BitConverter.GetBytes(player)), elemAddress + 0xA8);
                    return elemAddress;
    
            }
    
    How to cache unlocalized strings and get material index:
    Code:
            public uint cacheText(string text)
            {
                XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, gameAddresses.locString);
                XDRPCStringArgumentInfo txt = new XDRPCStringArgumentInfo(text);
                uint ind = xbCon.ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { txt });
                return ind;
            }
            public uint getMaterialIndex(string material)
            {
                XDRPCExecutionOptions optionz = new XDRPCExecutionOptions(XDRPCMode.Title, gameAddresses.material);
                XDRPCStringArgumentInfo name = new XDRPCStringArgumentInfo(material);
                uint de = xbCon.ExecuteRPC<uint>(optionz, new XDRPCArgumentInfo[] { name });
    
                return (de);
            }
    
    How to set an icon or shader:
    Code:
            public void setIcon(uint elem, uint shader, int width, int height, float x, float y, uint align, float sort = 0, int r = 255, int g = 255, int b = 255, int a = 255)
            {
                    SetMem(new byte[] { 0x00, 0x00, 0x00, 0x04 }, elem);
                    SetMem(uintBytes(0x05), elem + gameAddresses.relativeOffset);
                    SetMem(uintBytes(0x06), elem + gameAddresses.relativeOffset - 4);
                    SetMem(uintBytes(shader), elem + gameAddresses.shaderOffset);
                    SetMem(ReverseBytes(BitConverter.GetBytes(height)), elem + gameAddresses.heightOffset);
                    SetMem(ReverseBytes(BitConverter.GetBytes(width)), elem + gameAddresses.widthOffset);
                    SetMem(uintBytes(align), elem + gameAddresses.alignOffset);
                    SetMem(new byte[] { BitConverter.GetBytes(r)[0], BitConverter.GetBytes(g)[0], BitConverter.GetBytes(B)[0], BitConverter.GetBytes(a)[0] }, elem + gameAddresses.colorOffset);
                    SetMem(ReverseBytes(BitConverter.GetBytes(sort)), elem + gameAddresses.textOffset + 4);
                    SetMem(ReverseBytes(BitConverter.GetBytes(x)), elem + gameAddresses.xOffset);
                    SetMem(ReverseBytes(BitConverter.GetBytes(y)), elem + gameAddresses.yOffset);
    
                }
    
    How to set text:
    Code:
            public void setText(uint elem, byte[] text, uint font, float fontScale, float x, float y, uint align, int r = 255, int g = 255, int b = 255, int a = 255)
            {
                    SetMem(new byte[] { 0x00, 0x00, 0x00, 0x01 }, elem);
    
                    SetMem(text, elem + gameAddresses.textOffset + 2);
                    SetMem(uintBytes(0x05), elem + gameAddresses.relativeOffset);
                    SetMem(uintBytes(0x06), elem + gameAddresses.relativeOffset - 4);
                    SetMem(uintBytes(font), elem + gameAddresses.fontOffset);
                    SetMem(uintBytes(align), elem + gameAddresses.alignOffset);
                    SetMem(new byte[] { 0x40, 0x00 }, elem + gameAddresses.textOffset + 4);
                    SetMem(ReverseBytes(BitConverter.GetBytes(fontScale)), elem + gameAddresses.fontSizeOffset);
                    SetMem(ReverseBytes(BitConverter.GetBytes(x)), elem + gameAddresses.xOffset);
                    SetMem(ReverseBytes(BitConverter.GetBytes(y)), elem + gameAddresses.yOffset);
                    SetMem(new byte[] { BitConverter.GetBytes(r)[0], BitConverter.GetBytes(g)[0], BitConverter.GetBytes(B)[0], BitConverter.GetBytes(a)[0] }, elem + gameAddresses.colorOffset);
    
            }
    

    Credits:
    100% - Me



    Btw guys: I am teh1337, so hai.

    Oh and if staff see this please change my username as someone has already taken teh1337 <3

    If anyone doesn't believe this, please consult a leprechaun (conwell preferably).
     
    • Like Like x 4
  2. XPGProgrammer

    XPGProgrammer Newbie
    0/47

    Joined:
    Jan 2, 2013
    Messages:
    802
    Likes Received:
    214
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Canada
    Console:
    Xbox
    Yes, we all know you're the real one. By the way, you're a lil bit late ;P.
     
    • Like Like x 1
  3. GConwell

    GConwell Ain't No Picnic Lifetime Gold
    125/188

    Joined:
    Mar 7, 2011
    Messages:
    1,088
    Likes Received:
    394
    Trophy Points:
    125
    Gender:
    Male
    Occupation:
    DJ
    Location:
    Ireland
    Home Page:
    Console:
    Playstation 4
    glad to see you getting active carter
     
  4. Timmeh

    Timmeh Trve Kvlt
    25/47

    Joined:
    Jan 18, 2013
    Messages:
    472
    Likes Received:
    156
    Trophy Points:
    25
    Gender:
    Male
    Occupation:
    Drummer
    Location:
    Michigan
    Console:
    Xbox
    LOL
    but anyway great release Carter :p
     

Share This Page

Close