Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[c++] if and else if statements help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
shakib187
Expert Cheater
Reputation: 0

Joined: 24 May 2007
Posts: 215

PostPosted: Sun Jun 08, 2014 12:29 pm    Post subject: [c++] if and else if statements help Reply with quote

got it thanks!

Last edited by shakib187 on Tue Aug 26, 2014 7:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Jun 08, 2014 12:56 pm    Post subject: Reply with quote

If pointed is a float why are you using the int value of it? Also you can use a switch case instead of a giant if-else:
Code:
    while (1)
    {
        info();

        if (GetAsyncKeyState(VK_SPACE))
        {
            switch (pointed)
            {
            case 1036831949:
                Sleep(50);
                shoot();
                break;
            case 1045220557:
                Sleep(100);
                shoot2();
                break;
            case 1050253722:
                Sleep(200);
                shoot3();
                break;
            case 1053609165:
                Sleep(300);
                shoot4();
                break;
            case 1056964608:
                Sleep(400);
                shoot5();
                break;
            }
        }
    }


But if pointed is a float, why not read and use it as one?

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
shakib187
Expert Cheater
Reputation: 0

Joined: 24 May 2007
Posts: 215

PostPosted: Sun Jun 08, 2014 5:01 pm    Post subject: Reply with quote

atom0s wrote:
If pointed is a float why are you using the int value of it? Also you can use a switch case instead of a giant if-else:
Code:
    while (1)
    {
        info();

        if (GetAsyncKeyState(VK_SPACE))
        {
            switch (pointed)
            {
            case 1036831949:
                Sleep(50);
                shoot();
                break;
            case 1045220557:
                Sleep(100);
                shoot2();
                break;
            case 1050253722:
                Sleep(200);
                shoot3();
                break;
            case 1053609165:
                Sleep(300);
                shoot4();
                break;
            case 1056964608:
                Sleep(400);
                shoot5();
                break;
            }
        }
    }


But if pointed is a float, why not read and use it as one?


Thanks for the code atom0s and I would have to change a lot of variables which im too lazy to do at the moment lol
Back to top
View user's profile Send private message
shakib187
Expert Cheater
Reputation: 0

Joined: 24 May 2007
Posts: 215

PostPosted: Mon Jun 09, 2014 1:36 pm    Post subject: Reply with quote

Hey would it be possible to add in another check for a different pointer by doing the following?:

Code:

    while (1)
    {
        info();

        if (GetAsyncKeyState(VK_SPACE))
        {
            switch (pointed)
            {
            case 1036831949:
                Sleep(50);
                shoot();
                break;
            }
            switch(pointed2)
            {
           case 1036831999:
               Sleep(100);
               shoot();
               break;
            }
         }
    }

Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Mon Jun 09, 2014 1:48 pm    Post subject: Reply with quote

Yeah
_________________
A nagy kapu mellett, mindig van egy kis kapu.
----------------------
Come on...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites