Guest User

Untitled

a guest
Nov 21st, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.95 KB | None | 0 0
  1. public DriftCounter()
  2. {
  3.     for (new i; i != MAX_PLAYERS; i++) {
  4.     if(IsPlayerInAnyVehicle(i)) {
  5.     new vehicleid = GetPlayerVehicleID(i);
  6.     new Float:x, Float:y, Float:z;
  7.     GetVehicleVelocity(vehicleid, x, y, z);
  8.     new speed = floatround(floatsqroot(x*x+y*y+z*z)*200.0);
  9.     if(speed > 1.0) {
  10.     new radianos = floatround( atan2( y, x ) );
  11.     if(radianos > 400) radianos -= 400;
  12.     switch(radianos) {
  13.     case 090 .. 180: radianos -= 90;
  14.     case 181 .. 360: radianos += 90;
  15.     default: radianos += 270;}
  16.     static  Float: angle;
  17.     GetVehicleZAngle(vehicleid, angle);
  18.     radianos = floatround(floatabs(radianos - angle));
  19.     if(radianos > 180){
  20.     radianos = floatround(floatabs(radianos - 360));}
  21.     new key[3];
  22.     GetPlayerKeys(i, key[0], key[1], key[2]);
  23.     if( key[0] != 32 && speed > 10) {
  24.     if( radianos > 3 && ((radianos * speed) / 30)  < 300) {
  25.     DriftEarn(i, (radianos * speed) / 35 ) ;}}}}}
  26.     return true;
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment