All pastes #569857 Raw Edit

DriftScript

public text v1 · immutable
·published 2007-06-16 13:11 UTC
rendered paste body
public Speed(){
 new Float:dis;
 new Float:x,Float:y,Float:z;
 new Drift[200];
 new round;
 new i;
 new Float:RelAngle;
 new Float:TheAngle;
 for(i=0;i<MAX_PLAYERS;i++)if(IsPlayerConnected(i)){
  GetPlayerPos(i, x, y, z);
  TheAngle = GetPlayerTheoreticAngle(i);
  GetVehicleZAngle(GetPlayerVehicleID(i), RelAngle);
  if(IsPlayerInAnyVehicle(i)) {
   if(RelAngle < TheAngle){
    Drift[i] = floatround(floatsub(TheAngle, RelAngle));
   } else {
    Drift[i] = floatround(floatsub(RelAngle, TheAngle));
   }
   dis = floatsqroot(floatpower(floatabs(floatsub(x,ppos[i][0])),2)+floatpower(floatabs(floatsub(y,ppos[i][1])),2));
   round = floatround(floatmul((((dis/1000.0)*60.0)*60.0), 10.0));
   if(Drift[i] > 20 && Drift[i] < 120 && TheAngle!=0.00000 && round > 10 && round < 500){
    DriftP[i]+=(1*round*Drift[i])/6;
    new s[256]; format(s, 256, "~w~Drift : %d", DriftP[i]);
    GameTextForPlayer(i,s,100,5);
    }
   ppos[i][0] = x;
   ppos[i][1] = y;
   ppos[i][2] = z;
  }

 }
}