Thread: Correct FH?

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored

    Question Correct FH?

    I know that using this will make you fly higher and higher

    Code:
    		if(GetAsyncKeyState(VK_SPACE)<0)
    		PTC("PlayerGravity 700");
    but, how do you make it so that when you stop holding down the space bar, you will fall and not continue to rise?

  2. #2
    pashak's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    350
    Reputation
    29
    Thanks
    42
    yes.
    //tooshort..

  3. #3
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by pashak View Post
    yes.
    //tooshort..
    That didn't answer my question.

  4. #4
    pashak's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    350
    Reputation
    29
    Thanks
    42
    if(GetAsyncKeyState(VK_SPACE)) { }

  5. #5
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by pashak View Post
    if(GetAsyncKeyState(VK_SPACE)) { }
    Didn't work. I kept going up when i stoped holding down the space bar.

  6. #6
    pashak's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    350
    Reputation
    29
    Thanks
    42
    just use what you had in the beginning ._.

  7. #7
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    if ( FlyHack )
    Do Fly Hacks
    else
    Do Normal Gravity

  8. #8
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by whit View Post
    if ( FlyHack )
    Do Fly Hacks
    else
    Do Normal Gravity
    so your saying

    if spacebar.pressed
    gravity
    else
    nogravity

    ?

    But thats basically what i have

    Code:
    	if(Hack.fly){
    		if(GetAsyncKeyState(VK_SPACE)) { } 
    		PTC("PlayerGravity 700");
    	}else{
    		PTC("PlayerGravity -1000");
    	}
    All it does is keeps rising until you turn it off.
    Last edited by Cryptonic; 05-06-2011 at 09:39 PM.

  9. #9
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Code:
    	if(Hack.fly){
    		if(GetAsyncKeyState(VK_SPACE)) { } 
    		PTC("PlayerGravity 700");
    	}else{
    		PTC("PlayerGravity -1000");
    	}

    Code:
    	if(Hack.fly){
    		if(GetAsyncKeyState(VK_SPACE)&1) 
    		PTC("PlayerGravity 700");
    	else
    		PTC("PlayerGravity -1000");
    	}
    try that but im pretty sure the value for normal gravity is wrong

  10. #10
    pashak's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    350
    Reputation
    29
    Thanks
    42
    oh... thats what you wanted...
    Man I'm having a horrible day, I'm on pain meds
    Only good part..

  11. #11
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by whit View Post
    Code:
    	if(Hack.fly){
    		if(GetAsyncKeyState(VK_SPACE)) { } 
    		PTC("PlayerGravity 700");
    	}else{
    		PTC("PlayerGravity -1000");
    	}

    Code:
    	if(Hack.fly){
    		if(GetAsyncKeyState(VK_SPACE)&1) 
    		PTC("PlayerGravity 700");
    	else
    		PTC("PlayerGravity -1000");
    	}
    try that but im pretty sure the value for normal gravity is wrong
    Hm.. i dced o.o

    let me try it later... im tired, gonna go now.

  12. #12
    Mynameisname's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    44
    Reputation
    10
    Thanks
    1
    lol its because you are not looping, you should put that in a loop so when you release the space bar you will start falling, if you do not put that in a loop you will have to press space again to return false and start falling...

  13. #13
    Presiden's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    nnjnn
    Posts
    66
    Reputation
    10
    Thanks
    106
    Long time never hack ca, but try this:

    Code:
    bool fly; //or int
    
    if(GetAsyncKeyState(VK_SPACE)<0)
    fly =! fly;
    
    if (fly)
    PTC("PlayerGravity 700");
    else
    PTC("PlayerGravity -1000");

  14. #14
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Quote Originally Posted by Presiden View Post
    Long time never hack ca, but try this:

    Code:
    bool fly; //or int
    
    if(GetAsyncKeyState(VK_SPACE)<0)
    fly =! fly;
    
    if (fly)
    PTC("PlayerGravity 700");
    else
    PTC("PlayerGravity -1000");
    Hmm that dced too.

    and you for at a } at the bottom.

  15. #15
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    831
    Reputation
    44
    Thanks
    401
    My Mood
    Twisted
    lol?
    Nobody can code here?! Its so easy guys
    [html]
    if(fly)
    {
    if(GetAsyncKeyState(VK_space)
    PTC("PlayerGravity 700");
    else
    PTC("PlayerGravity -1200");
    }
    [/html]

    Progress with my game - "Disbanded"
    • Fixed FPS lag on spawning entities due to the ent_preload buffer!
    • Edit the AI code to get some better pathfinding
    • Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
    • Added a new silencer for ALL weapons. Also fixed the rotation bugs
    • Added a ton of new weapons and the choice to choose a silencer for every weapon
    • Created a simple AntiCheat, noobs will cry like hell xD
    • The name will be Disbanded, the alpha starts on the 18th august 2014



    Some new physics fun (Serversided, works on every client)



    My new AI
    https://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    https://www.youtube.com/watch?v=Na2kUdu4d_k

Page 1 of 2 12 LastLast