Chams not working [C#]

Posts 1–9 of 9 · Page 1 of 1
Chams not working [C#]
So, to clarify, I've coded chams before in C++ but they aren't working in my C# code.

Code:
void DrawCham(uint entity, byte r, byte g, byte b, byte a)
        {
            myPlayer.fProcess.WriteByte((int)(entity + 0x70), r);
            myPlayer.fProcess.WriteByte((int)(entity + 0x74), g);
            myPlayer.fProcess.WriteByte((int)(entity + 0x78), b);
            myPlayer.fProcess.WriteByte((int)(entity + 0x7C), a);
        }

public void CHAMS()
        {
            if (Toggles.Default.Chams)
            {                
                for (int i = 0; i < 32; i++)
                {
                    if (myPlayer.ENTEAM(i) == myPlayer.TEAM())
                    {
                        DrawCham(myPlayer.BASEENT(i), (byte)0, (byte)255, (byte)0, (byte)255);
                    }
                    else if (myPlayer.ENTEAM(i) != myPlayer.TEAM())
                    {
                        DrawCham(myPlayer.BASEENT(i), (byte)255, (byte)0, (byte)0, (byte)255);
                    }
                }                              
            }
        }
I used WriteByte because the C++ Color class uses unsigned char, which is the C# equivalent of byte, from what I've read. The result of this was pink enemies and blue teammates, when it should have been red enemies and green teammates.
Any ideas?
Quote Originally Posted by KappaMang View Post
So, to clarify, I've coded chams before in C++ but they aren't working in my C# code.

Code:
void DrawCham(uint entity, byte r, byte g, byte b, byte a)
        {
            myPlayer.fProcess.WriteByte((int)(entity + 0x70), r);
            myPlayer.fProcess.WriteByte((int)(entity + 0x74), g);
            myPlayer.fProcess.WriteByte((int)(entity + 0x78), b);
            myPlayer.fProcess.WriteByte((int)(entity + 0x7C), a);
        }

public void CHAMS()
        {
            if (Toggles.Default.Chams)
            {                
                for (int i = 0; i < 32; i++)
                {
                    if (myPlayer.ENTEAM(i) == myPlayer.TEAM())
                    {
                        DrawCham(myPlayer.BASEENT(i), (byte)0, (byte)255, (byte)0, (byte)255);
                    }
                    else if (myPlayer.ENTEAM(i) != myPlayer.TEAM())
                    {
                        DrawCham(myPlayer.BASEENT(i), (byte)255, (byte)0, (byte)0, (byte)255);
                    }
                }                              
            }
        }
I used WriteByte because the C++ Color class uses unsigned char, which is the C# equivalent of byte, from what I've read. The result of this was pink enemies and blue teammates, when it should have been red enemies and green teammates.
Any ideas?
Not gonna look through everything but m_clrRender consists of only 3 bytes.
You are also saying that a byte is the size of an int which it is not,

0x70,0x71,0x72 is what you need
Quote Originally Posted by SilentWarp View Post
Not gonna look through everything but m_clrRender consists of only 3 bytes.
You are also saying that a byte is the size of an int which it is not,

0x70,0x71,0x72 is what you need
Ohh, silly mistake I made when I changed it from int to byte. 0x73 would be the alpha, correct?
Quote Originally Posted by KappaMang View Post
Ohh, silly mistake I made when I changed it from int to byte. 0x73 would be the alpha, correct?
You'd think but it doesn't do anything.
Quote Originally Posted by SilentWarp View Post
You'd think but it doesn't do anything.
Then how do you do bloom chams?
clrRender != chams smh
Quote Originally Posted by Aphu View Post
clrRender != chams smh
We know that but I called it semi-chams in my thread because of the models and fullbloom.

- - - Updated - - -

Quote Originally Posted by KappaMang View Post
Then how do you do bloom chams?
The GlowStruct contains m_bFullBloom.
Should work isn't it?
Been over a week since last update/bump after answers, assuming solved.

/Closed.
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us