Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*================================== FS DE RADAR ====================================
- ============================ By: Sivi =============================
- =================== Edit. por Sivi ======================
- ============ ñ TIRE os CREDTS ==============*/
- #include <a_samp>
- //----------------------------------------
- new UpdateSeconds = 2; // Não Mecher
- new maxobject = 4;
- //----------------------------------------
- new Multas[MAX_PLAYERS];
- 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, 1524.1971,-1674.1224,13.5469, 90, 110); // Radar da DP PM
- AddFlitsPaal(i, 1278, 1486.7902,-1726.9485,13.5469, 90, 110); // Prefeitura
- AddFlitsPaal(i, 1278, 1454.1200,-1039.0997,23.8281, 90, 110); // BANCO
- AddFlitsPaal(i, 1278, 1993.0825,-1453.5201,13.5547, 90, 110); // HOSPITAL
- AddFlitsPaal(i, 1278, 1927.7516,-1757.6179,13.5469, 90, 110); // POSTO
- AddFlitsPaal(i, 1278, 1480.6022,-1867.0929,13.5469, 90, 110); // ATRAS DA PREF
- AddFlitsPaal(i, 1278, 1351.3029,-1291.9943,14.0469, 90, 110); // AMMU NATION
- AddFlitsPaal(i, 1278, 1766.7039,-1172.4738,23.8281, 90, 110); // LOJA DE ARMAS 1
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 90, 110); // VAGO
- AddFlitsPaal(i, 1278, 0000.0000,0000.0000,0000.0000, 90, 110); // VAGO
- //===================TEXTOS===================By: Sivi
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1524.1971,-1674.1224,13.5469,100.0,0); //DP
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1486.7902,-1726.9485,13.5469,100.0,0); //PREF
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1454.1200,-1039.0997,23.8281,100.0,0); //BANCO
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1927.7516,-1757.6179,13.5469,100.0,0); //POSTO
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1766.7039,-1172.4738,23.8281,100.0,0); //L. ARMA 1
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1351.3029,-1291.9943,14.0469,100.0,0); //AMMU NATION
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1348.7843,-1269.7135,14.0469,100.0,0); //AMMU NATION
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1993.0825,-1453.5201,13.5547,100.0,0); //HOSPITAL
- Create3DTextLabel("RADAR\nVelocidade\nMaxima 110 KM/H",COLOR_YELLOW,1480.6022,-1867.0929,13.5469,100.0,0); //ATRAS DA PREF
- }
- }
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/radar", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,0xFF0000AA,"******* 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 voce exceder o Limite de velocidade Nesses Locais , Levara Multa de 2000 $ ");
- SendClientMessage(playerid,0xFF0000AA,"Atenciosamente , A administração.");
- return 1;
- }
- if(!strcmp(cmdtext, "/pagarmulta", true))
- {
- if(Multas[playerid] == 0) return SendClientMessage(playerid, 0xFFFFFFAA, "Não há multas a serem pagas!");
- new STR[50];
- format(STR, 50, "Total de Multas: %d. Valor a pagar: %d", Multas[playerid], (Multas[playerid] * 2000));
- SendClientMessage(playerid, 0xFFFF00AA, STR);
- SendClientMessage(playerid, 0xFFFFFFAA, "Você pagou suas multas !");
- GivePlayerMoney(playerid, -1 * (Multas[playerid] * 2000));
- Multas[playerid] = 0;
- return 1;
- }
- return 0;
- }
- 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++;
- }
- new Velocimetro = distance1[playerid] + 33;
- if((Velocimetro)>speed)
- {
- if(IsPlayerInCircle(playerid, xx, yy, radius) && GetPlayerState(playerid)== PLAYER_STATE_DRIVER)
- {
- fine[playerid]=((distance1[playerid]*17/10)-speed);
- Multas[playerid] += 1;
- format(str,sizeof(str), "{FFFF00}[INFO-RADAR] {FF0000}O Limite de velocidade é {FFFF00}%d KM/H. {FF0000}Você Passou a {FFFF00}%d KM/H {FF0000}e foi {FFFF00}MULTADO !",speed, Velocimetro);
- // 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);
- SendClientMessage(playerid, 0x33CCFFAA, "Digite /pagarmulta para pagar suas multas !");
- PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment