Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #define MAX_RADAR 5
- #define VALOR_MIN 3
- #define ID_OBJ 1616
- enum Ri
- {
- Vel,
- Float:PosX,
- Float:PosY,
- Float:PosZ,
- Float:RotX,
- Float:RotY,
- Float:RotZ
- }
- //id 161
- new RadarInfo[MAX_RADAR][Ri] ={
- {50, 1575.54480, 843.25104, 7.10699, 0.00000, 0.00000, 198.78409},
- {50, 1797.10754, 1281.21106, 6.17700, 0.00000, 0.00000, 303.55508},
- {50, 468.98901, 2463.41211, 7.12612, 0.00000, 0.00000, 25.29004},
- {50, 1217.29907, 1804.95227, 7.06541, 0.00000, 0.00000, 117.86958},
- {50, 316.02972, 764.41522, 5.76512, 0.00000, 0.00000, 52.20359}
- };
- new MinhaVelocidade[MAX_PLAYERS],
- MinhaMulta[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- SetTimer("DSRadar", 200, true);
- for(new i = 0; i < MAX_RADAR; i++)
- {
- CreateObject(ID_OBJ, RadarInfo[i][PosX], RadarInfo[i][PosY], RadarInfo[i][PosZ], RadarInfo[i][RotX], RadarInfo[i][RotY], RadarInfo[i][RotZ]);
- }
- return 1;
- }
- public OnFilterScriptExit(){return 1;}
- forward DSRadar();
- public DSRadar()
- {
- new Var[100], vehicleid, Float:speed_x, Float:speed_y, Float:speed_z, Float:final_speed, final_speed_int;
- for(new i = 0; i < MAX_PLAYERS; i++) {
- if(!IsPlayerInAnyVehicle(i))return true;
- for(new z = 0; z < MAX_RADAR; z++) {
- if(IsPlayerInRangeOfPoint(i, 15.0, RadarInfo[z][PosX], RadarInfo[z][PosY], RadarInfo[z][PosZ])) {
- GetVehicleVelocity(vehicleid, speed_x, speed_y, speed_z);
- 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);
- MinhaVelocidade[i] = final_speed_int;
- if(RadarInfo[z][Vel] > MinhaVelocidade[i]){
- MinhaMulta[i] += VALOR_MIN * MinhaVelocidade[i];
- 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]);
- SendClientMessage(i, -1, Var);
- }
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement