Advertisement
Guest User

[FilterScript] FS Radar v0.1 / OficialSAMP

a guest
May 25th, 2013
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.43 KB | None | 0 0
  1.    
  2.  
  3.     #include                  a_samp
  4.      
  5.     #define      MAX_RADAR       5
  6.     #define      VALOR_MIN       3
  7.     #define      ID_OBJ          1616
  8.      
  9.     enum Ri
  10.     {
  11.        Vel,
  12.        Float:PosX,
  13.        Float:PosY,
  14.        Float:PosZ,
  15.        Float:RotX,
  16.        Float:RotY,
  17.        Float:RotZ
  18.     }
  19.      
  20.     //id 161
  21.     new RadarInfo[MAX_RADAR][Ri] ={
  22.     {50, 1575.54480, 843.25104,  7.10699,   0.00000, 0.00000, 198.78409},
  23.     {50, 1797.10754, 1281.21106, 6.17700,   0.00000, 0.00000, 303.55508},
  24.     {50, 468.98901,  2463.41211, 7.12612,   0.00000, 0.00000, 25.29004},
  25.     {50, 1217.29907, 1804.95227, 7.06541,   0.00000, 0.00000, 117.86958},
  26.     {50, 316.02972,  764.41522,  5.76512,   0.00000, 0.00000, 52.20359}
  27.     };
  28.      
  29.     new MinhaVelocidade[MAX_PLAYERS],
  30.         MinhaMulta[MAX_PLAYERS];
  31.      
  32.     public OnFilterScriptInit()
  33.     {
  34.         SetTimer("DSRadar", 200, true);
  35.         for(new i = 0; i < MAX_RADAR; i++)
  36.         {
  37.             CreateObject(ID_OBJ, RadarInfo[i][PosX], RadarInfo[i][PosY], RadarInfo[i][PosZ], RadarInfo[i][RotX], RadarInfo[i][RotY], RadarInfo[i][RotZ]);
  38.         }
  39.         return 1;
  40.     }
  41.      
  42.     public OnFilterScriptExit(){return 1;}
  43.      
  44.     forward DSRadar();
  45.     public DSRadar()
  46.     {
  47.         new Var[100], vehicleid, Float:speed_x, Float:speed_y, Float:speed_z, Float:final_speed, final_speed_int;
  48.         for(new i = 0; i < MAX_PLAYERS; i++) {
  49.             if(!IsPlayerInAnyVehicle(i))return true;
  50.      
  51.             for(new z = 0; z < MAX_RADAR; z++) {
  52.                 if(IsPlayerInRangeOfPoint(i, 15.0, RadarInfo[z][PosX], RadarInfo[z][PosY], RadarInfo[z][PosZ])) {
  53.                     GetVehicleVelocity(vehicleid, speed_x, speed_y, speed_z);
  54.                     final_speed = floatsqroot(((speed_x * speed_x) + (speed_y * speed_y)) + (speed_z * speed_z)) * 158.179; final_speed_int = floatround(final_speed, floatround_round);
  55.                     MinhaVelocidade[i] = final_speed_int;
  56.                     if(RadarInfo[z][Vel] > MinhaVelocidade[i]){
  57.                         MinhaMulta[i] += VALOR_MIN * MinhaVelocidade[i];
  58.                         format(Var ,sizeof Var,"Você foi multado em R$ %d , por estar em %d . Sua multa total agora é R$ %d .", 3 * MinhaVelocidade[i],MinhaVelocidade[i], MinhaMulta[i]);
  59.                         SendClientMessage(i, -1, Var);
  60.                     }
  61.                 }
  62.             }
  63.         }
  64.         return true;
  65.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement