[HELP] Source code mess up?

Posts 1630 of 34 · Page 2 of 3
Quote Originally Posted by Injection View Post


Look at the end of the else statement. He either left out the last '}' or his else statement is missing it.

Yes you are right my mistake i thought you were meaning my code my apologies.
I do it like so [php]
void main()
{
bool hack = false;
while(true)
{
if(GetAsyncKeyState(VK_NUMPAD0) < 0){ //NX Chams
if( hack == false ){
PushToConsole("SkelModelStencil 1");
hack = true;
} else {
PushToConsole("SkelModelStencil 0");
hack = false;
}
Sleep(200);
}
}
}[/php]
Quote Originally Posted by richdude212 View Post
I do it like so [php]
void main()
{
bool hack = false;
while(true)
{
if(GetAsyncKeyState(VK_NUMPAD0) < 0){ //NX Chams
if( hack == false ){
PushToConsole("SkelModelStencil 1");
hack = true;
} else {
PushToConsole("SkelModelStencil 0");
hack = false;
}
Sleep(200);
}
}
}[/php]
Ohhh you have to run a check to see if the hack is true or false xD Thanks
Quote Originally Posted by jonnyboy9985 View Post
Ohhh you have to run a check to see if the hack is true or false xD Thanks
No offense dude, but thats a really horrible way to do it.

Code:
Speed = !Speed
like Frit0 said, would solve everything. Where speed is defined as a boolean value.
So when its true, this instruction makes the bool value to its opposite. Ergo, it will become false
When true, make it false
When false, make it true.

So, when you do press numpad 1 to turn on your hack, Speed (that was false) will turn into Speed(thats true) So now, if you have a check for it being true, you can run your console command and completely eliminate your else statement. Its a much more efficient and cleaner way to do it.
Quote Originally Posted by Revolvium View Post
No offense dude, but thats a really horrible way to do it.

Code:
Speed = !Speed
like Frit0 said, would solve everything. Where speed is defined as a boolean value.
So when its true, this instruction makes the bool value to its opposite. Ergo, it will become false
When true, make it false
When false, make it true.

So, when you do press numpad 1 to turn on your hack, Speed (that was false) will turn into Speed(thats true) So now, if you have a check for it being true, you can run your console command and completely eliminate your else statement. Its a much more efficient and cleaner way to do it.

Thank you Revolvium for explaining that.
Alright now you are BOTH wrong... I run this in game, and I come up with no results... Fps doesn't show up, nx chams dont, speed doesn't either, and I replaced it with your guys' codes and NEITHER worked :P What is the code for reacting on the pressing of a button?
This should work perfectly
Code:
if(GetAsyncKeyState(VK_NUMPAD3)<0)
	{
                        PushToConsole ("BaseMoveAccel 3000.000000");
			PushToConsole ("StartAccel 500.000000");
			PushToConsole ("MaxAccel 3000.000000");
			PushToConsole ("AccelInc 6000.000000");
			PushToConsole ("WalkVel 70.000000") ;
			PushToConsole ("FRunVel 285.000000");
			PushToConsole ("BRunVel 285.000000");
			PushToConsole ("SRunVel 285.000000");
			PushToConsole ("DuckVel 50.000000");
			speed = 0;//false
		}
		else
		{
			PushToConsole ("BaseMoveAccel 3000.000000");
			PushToConsole ("StartAccel 3000.000000");
			PushToConsole ("MaxAccel 3000.000000");
			PushToConsole ("AccelInc 3000.000000");
			PushToConsole ("FRunVel 3000.000000");
			PushToConsole ("BRunVel 3000.000000");
			PushToConsole ("SRunVel 30000.000000");
			PushToConsole ("DuckVel 3000.000000");
			speed = 1;//true

}
[php]
bool hack = false;

if(GetAsyncKeyState(VK_NUMPAD1){
hack = !hack
}

if(hack){

//On
}else{

//Off
}

[/php]
Quote Originally Posted by markoj View Post
This should work perfectly
Code:
if(GetAsyncKeyState(VK_NUMPAD3)<0)
	{
                        PushToConsole ("BaseMoveAccel 3000.000000");
			PushToConsole ("StartAccel 500.000000");
			PushToConsole ("MaxAccel 3000.000000");
			PushToConsole ("AccelInc 6000.000000");
			PushToConsole ("WalkVel 70.000000") ;
			PushToConsole ("FRunVel 285.000000");
			PushToConsole ("BRunVel 285.000000");
			PushToConsole ("SRunVel 285.000000");
			PushToConsole ("DuckVel 50.000000");
			speed = 0;//false
		}
		else
		{
			PushToConsole ("BaseMoveAccel 3000.000000");
			PushToConsole ("StartAccel 3000.000000");
			PushToConsole ("MaxAccel 3000.000000");
			PushToConsole ("AccelInc 3000.000000");
			PushToConsole ("FRunVel 3000.000000");
			PushToConsole ("BRunVel 3000.000000");
			PushToConsole ("SRunVel 30000.000000");
			PushToConsole ("DuckVel 3000.000000");
			speed = 1;//true

}
thats what I had but it was laggy

Quote Originally Posted by ac1d_buRn View Post
[php]
bool hack = false;

if(GetAsyncKeyState(VK_NUMPAD1){
hack = !hack
}

if(hack){

//On
}else{

//Off
}

[/php]
aren't you forgetting something?? after "if(GetAsyncKeyState(VK_NUMPAD1)"
dont you need a <0??
Quote Originally Posted by jonnyboy9985 View Post
thats what I had but it was laggy



aren't you forgetting something?? after "if(GetAsyncKeyState(VK_NUMPAD1)"
dont you need a <0??
Yes i am. Forgot it. lol
Quote Originally Posted by jonnyboy9985 View Post
thats what I had but it was laggy



aren't you forgetting something?? after "if(GetAsyncKeyState(VK_NUMPAD1)"
dont you need a <0??
<0 means a constant flow of that key being pressed. you do not want this for an on/off hotkey. use &1 instead.
void meHackThread(){
DECLARE FUNCTION GLOBALS


while(1){//a while loop to keep checking hotkeys and what hacks are on
if(GetAsyncKeyState(VK_F1)&1){myvare = !myvar;}//Create Hotkey


if(myvar){
dohack;
}
else {
donorm;
}
Sleep(50);//give the loop so well deserved rest
}//close loop
}//close function

and whoever said that 0 can be false or true

shut up 0 = false true = 1....

omg wheres the edit key!

btw sorry i misread your post
Quote Originally Posted by jonnyboy9985 View Post
thats what I had but it was laggy

If its laggy you just add a sleep function inside the While loop and it should eliminate all lag, like he says below.


Quote Originally Posted by TheFallenOwns View Post
void meHackThread(){
DECLARE FUNCTION GLOBALS


while(1){//a while loop to keep checking hotkeys and what hacks are on
if(GetAsyncKeyState(VK_F1)&1){myvare = !myvar;}//Create Hotkey


if(myvar){
dohack;
}
else {
donorm;
}
Sleep(50);//give the loop so well deserved rest
}//close loop
}//close function
What about the fact that I need to press the button REALLY fast in order to activate it? And I thought it doesn't matter what way you order it? Like normal first, then hack?
Quote Originally Posted by jonnyboy9985 View Post
What about the fact that I need to press the button REALLY fast in order to activate it? And I thought it doesn't matter what way you order it? Like normal first, then hack?
I have that problem to so idk how to fix it, maybe try replacing <0 with &1, and it does matter because you could have the hacks turned on when you enter a game, then when you press the button hey would turn off.
Posts 1630 of 34 · Page 2 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?