Advertisement
Guest User

best function

a guest
Dec 7th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. cPlayer* g_pPlayer = new cPlayer;
  2. void cPlayer::Bhop(CUserCmd* pCmd)
  3. {
  4. static auto bJumped = false;
  5. static auto bFake = false;
  6. if(!bJumped && bFake)
  7. {
  8. bFake = false;
  9. pCmd->buttons |= IN_JUMP;
  10. }
  11. else if(pCmd->buttons & IN_JUMP)
  12. {
  13. if(Global::LocalPlayer->GetFlags() & FL_ONGROUND)
  14. {
  15. bJumped = true;
  16. bFake = true;
  17. }
  18. else
  19. {
  20. pCmd->buttons &= ~IN_JUMP;
  21. bJumped = false;
  22. }
  23. }
  24. else
  25. {
  26. bJumped = false;
  27. bFake = false;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement