Advertisement
Shiny_

Untitled

Sep 6th, 2013
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1.     float floatsqroot(float value) {
  2.         return sqrt(value);
  3.     }
  4.  
  5.     float floatadd(float oper1, float oper2) {
  6.         return oper1 + oper2;
  7.     }
  8.  
  9.     float floatpower(float value, float exponent) {
  10.         return pow(value, exponent);
  11.     }
  12.        
  13.     float floatsub(float oper1, float oper2) {
  14.         return oper2 - oper1;
  15.     }
  16.  
  17.     float floatabs(float value) {
  18.         return abs(value);
  19.     }
  20.  
  21.     float floatmul(float oper1, float oper2) {
  22.         return oper1 * oper2;
  23.     }
  24.  
  25.     float floatround(float value) {
  26.         return (value > 0.0)? (value + 0.5): (value - 0.5);
  27.         /* return floorf(value + 0.5); */
  28.     }
  29.  
  30.     int GetPlayerSpeed(int v) {
  31.         float X;
  32.         float Y;
  33.         float Z;
  34.         GetVehicleVelocity(v, &X, &Y, &Z);
  35.         return floatround(floatsqroot(floatpower(X, 2.0) + floatpower(Y, 2.0) + floatpower(Z, 2.0)) * 190);
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement