Advertisement
ZEROMemories

Velocity Test

Mar 10th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. if (VelocityTest)
  2. {
  3. int analogX = Buttons::AnalogMonitoring(Buttons::LeftX);
  4. int analogY = Buttons::AnalogMonitoring(Buttons::LeftY);
  5.  
  6. float x = 0.0, y = 0.0, z = 0.0;
  7.  
  8. if (analogY == 0 || analogY == 254)
  9. {
  10. if (analogY == 0)y += 10.0f;
  11. if (analogY == 254) y -= 10.0f;
  12. }
  13. if (analogX == 0 || analogX == 254)
  14. {
  15. if (analogX == 0) x -= 10.0f;
  16. if (analogX == 254) x += 10.0f;
  17. }
  18. if (Buttons::isDown(Buttons::Button_A))
  19. {
  20. x *= 2.5f;
  21. y *= 2.5f;
  22. }
  23. Func::SET_ENTITY_VELOCITY(player_ped_id, x, y, z);
  24. Func::SET_ENTITY_ROTATION(player_ped_id, &Func::get_gameplay_cam_rot(2), 2, 1);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement