[C++] CA NA Hotkey?

Posts 1–15 of 19 · Page 1 of 2
[C++] CA NA Hotkey?
this is my main code:
Code:
void main()
{
    bool walls = false;
    while(true)
{
if(GetAsyncKeyState(VK_INSERT)<0){       
            if(walls){ 
                memcpy((LPVOID)0x57207A, "\x6A\x01", 2);
                walls = false; 
            } else { 
                memcpy((LPVOID)0x57207A, "\x6A\x00", 2);
                walls = true; 
            } 
        }
}
}
Does this look right?
Because when I first press insert the glass walls activate then when I press again it deactivates.
On the third attempt, it deactivates again and fourth attempt it deactivates again. After it activates... So screwed...

How can I make it more consistent in activation?
Am i placing my bool walls = false; in the wrong place?
Just do
walls = !walls;
before the if statement.
nvm found it. it means if walls is not equal to walls.
Doesnt make sense. :O HUH?
Quote Originally Posted by ppl2pass View Post
what does
walls = !walls;
mean?
Im here to learn as well
! is an operator reverses things.

walls = !walls; makes walls the opposite of what it is.

Another example is in an if statement :

Code:
if(!(x > 5)){ ... }
That would be if x is less than 5.

Why is that confusing. o.O
btw is it bool walls = !walls; ?
Cause u have to define the variable?
Quote Originally Posted by ppl2pass View Post
btw is it bool walls = !walls; ?
Cause u have to define the variable?
Why would you declare it again ? You already have before the while loop.

Code:
void main()
{
    bool walls = false;
    while(true)
    {
        if(GetAsyncKeyState(VK_INSERT)<0){     
            walls = !walls;  
            if(walls){ 
                memcpy((LPVOID)0x57207A, "\x6A\x01", 2);
            } else { 
                memcpy((LPVOID)0x57207A, "\x6A\x00", 2);
            }
            Sleep(300);

        }
        Sleep(10);

    }
}
Quote Originally Posted by zmansquared View Post
noob coders....
you're noob compared to gordon
am i? you dont know me kid
Quote Originally Posted by zmansquared View Post
am i? you dont know me kid
http://www.mpgh.net/forum/31-c-c/126817-go-site.html

Yeah, you are. You're pathetic argument with me in this thread gave me enough reason to disrespect you. Don't go around calling people noob coders when you hardly know anything yourself.
why do you freaking always go back to that???? i can code, so idc what you think. talk to whit, and everyone else
from what i've seen so far...i'd rather have zman help me out then some1 who can't let a small argument in an online forum thread go...
thank you. void has something against me for some reason. idk why, maybe cause i can out code him?

let me know if you need help
wait...are you Gordon? as in sys?

if u are, then hell yeah u can out code him lol
Posts 1–15 of 19 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us