Advertisement
Guest User

[FilterScript] FS Radar v0.1 / HomeHots.net

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