Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // SISTEMA FEITO POR: DESCONHECIDO
- // SISTEMA DE EDITADO E TRADUZIDO POR Pedro_Felipe - Pedro_Tilambucu
- //----------------------------------------
- new UpdateSeconds = 2; // Não Mecher
- new maxobject = 4;
- //----------------------------------------
- public OnFilterScriptInit() {
- print("\n----------------------------------");
- print("[FS] Radar Automatico Carregado");
- print("----------------------------------\n");
- SetTimer("UpdateSpeed", UpdateSeconds*1000, 1);
- }
- public OnFilterScriptExit() {
- print("\n----------------------------------");
- print("[FS] Radar Automatico Desativado");
- print("----------------------------------\n");
- }
- forward UpdateSpeed(playerid);
- enum SavePlayerPosEnum {
- Float:LastX,
- Float:LastY,
- Float:LastZ
- }
- #define COLOR_YELLOW 0xFFFF00AA
- #define VERDEFRACO 0x80cf80AA
- #define SLOTS 500
- new objectcreated;
- new SavePlayerPos[SLOTS][SavePlayerPosEnum];
- new distance1[MAX_PLAYERS];
- public UpdateSpeed(playerid)
- {
- new Float:x,Float:y,Float:z;
- new Float:distance,value;
- for(new i=0; i<SLOTS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(i, x, y, z);
- distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
- value = floatround(distance * 3600);
- if(UpdateSeconds > 1)
- {
- value = floatround(value / UpdateSeconds);
- }
- distance1[i] = floatround(value/1600);
- SavePlayerPos[i][LastX] = x;
- SavePlayerPos[i][LastY] = y;
- SavePlayerPos[i][LastZ] = z;
- /* Para colocar Coordenada no lugar que voce quer , basta colocar a Coordenada X,Y,Z no lugar dos 00000 ,
- o 40 é o raio que o radar pega, e o 50 , é a velocidade maxima*/
- AddFlitsPaal(i, 1278, 1476.2402,-1726.3396,13.5469, 40, 50); // Radar da DP PM
- AddFlitsPaal(i, 1278, 1524.1256,-1679.0756,13.5469, 40, 50); // Prefeitura
- AddFlitsPaal(i, 1278, 2048.7131,1353.5975,10.6719, 40, 50); // BANCO
- AddFlitsPaal(i, 1278, 1200.9847,-1337.9875,13.3984, 40, 45); // HOSPITAL
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 50, 70); // VAGO
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 20, 50); // VAGO
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 20, 50); // VAGO
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 20, 50); // VAGO
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 20, 50); // VAGO
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 20, 50); // VAGO
- }
- }
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- IsPlayerInCircle(playerid,Float:x,Float:y,radius)
- {
- if(GetPlayerDistanceToPoint(playerid,Float:x,Float:y) < radius)
- {
- return 1;
- }
- return 0;
- }
- GetPlayerDistanceToPoint(playerid,Float:x,Float:y)
- {
- new Float:x1,Float:y1,Float:z1; GetPlayerPos(playerid,x1,y1,z1);
- new Float:tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+
- floatpower(floatabs(floatsub(y,y1)),2));
- return floatround(tmpdis);
- }
- stock AddFlitsPaal(playerid, modelid, Float:xx, Float:yy, Float:zz, radius, speed)
- {
- new fine[MAX_PLAYERS];
- new str[256];
- if(objectcreated!=maxobject)
- {
- CreateObject(modelid, xx, yy, zz, 0.0, 0.0, 10);
- objectcreated++;
- }
- if((distance1[playerid])>speed)
- {
- if(IsPlayerInCircle(playerid, xx, yy, radius) && GetPlayerState(playerid)== PLAYER_STATE_DRIVER)
- {
- fine[playerid]=((distance1[playerid]*17/10)-speed);
- GivePlayerMoney(playerid, -2000);
- format(str,sizeof(str), "[RADAR xXX ] O Limite de velocidade é %d KM/H Voce Passou a %d KM/H e foi multado!",speed, distance1[playerid] ,fine[playerid]);
- // Caso queira mudar o nome do radar , é so mudar o xXx pelo nome que quiser. e o -2000 é o valor da multa.
- SendClientMessage(playerid, VERDEFRACO, str);
- PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
- }
- }
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- if (strcmp("/sradar", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0x33CCFFAA,"******* SISTEMA DE RADAR ************");
- SendClientMessage(playerid,0x33CCFFAA,"Existem Radar na Prefeitura, No Hospital e no DP's de Los Santos e Banco");
- SendClientMessage(playerid,0x33CCFFAA,"O Limite de velocidade é entre 50 KM/H");
- SendClientMessage(playerid,0x33CCFFAA,"Se você exceder o Limite de velocidade Nesses Locais , Levara Multa de 2000 $ ");
- SendClientMessage(playerid,0xAA3333AA,"Atenciosamente , A administração.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement