Jump to content
  • 0

Intrebare Radar


SaLiErY

Question

Buna Folosesc Un Radar De Pe Net si am o intrebare cum pot mari viteaza adica in oras viteza maxima e de 50 KM/h cum o pot mari

#include <a_samp>
// SISTEMA DE RADAR FEITO 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 radio , que o radar pega, e o 50 , é a velocidade maxima*/
			AddFlitsPaal(i, 1278, 1477.366089, -1725.674316, 13.093750, 40, 50); 
        	AddFlitsPaal(i, 1278, 1524.257935, -1703.046753, 13.093750, 40, 50); // Prefeitura
        	AddFlitsPaal(i, 1278, 1092.917847, -1857.532471, 13.097494, 40, 50); // BANCO
        	AddFlitsPaal(i, 1278, 1205.723633, -1857.804932, 13.093750, 40, 50); // HOSPITAL
        	AddFlitsPaal(i, 1278, 1305.047485, -1830.348755, 13.093750, 40, 50); // VAGO
        	AddFlitsPaal(i, 1278, 1305.518433, -1694.936890, 13.093750, 40, 50); // VAGO
        	AddFlitsPaal(i, 1278, 1306.388184, -1554.258057, 13.093750, 40, 50); // VAGO
        	AddFlitsPaal(i, 1278, 1339.077515, -1480.506714, 13.093750, 40, 50); // VAGO
        	AddFlitsPaal(i, 1278, 1363.483276, -1330.381836, 13.085953, 40, 50); // VAGO
        	AddFlitsPaal(i, 1278, 1260.221436, -1144.856689, 23.203125, 40, 50); // VAGO
        	AddFlitsPaal(i, 1278, 1136.905029, -1144.872192, 23.203125, 40, 50); // VAGO2
        	AddFlitsPaal(i, 1278, 850.989685, -1144.811401, 23.203125, 40, 50); // VAGO3
        	AddFlitsPaal(i, 1278, 1321.595947, -1400.469238, 12.867904, 40, 50); // VAGO4
        	AddFlitsPaal(i, 1278, 1252.426147, -1400.511963, 12.554832, 40, 50); // VAGO5
        	AddFlitsPaal(i, 1278, 1121.756714, -1400.513062, 12.957708, 40, 50); // VAGO6
        	AddFlitsPaal(i, 1278, 1008.723206, -1400.474365, 12.570202, 40, 50); // VAGO7
        	AddFlitsPaal(i, 1278, 909.299805, -1400.526001, 12.755013, 40, 50); // VAGO8
        	AddFlitsPaal(i, 1278, 758.733704, -1400.561768, 12.914063, 40, 50); // VAGO9
        	AddFlitsPaal(i, 1278, 1001.455505, -964.044434, 40.831264, 40, 50); // VAGO9
		}
	}
}

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] Limita de viteza este de %d KM/H tu ai mers cu %d KM/H si ai luat amenda!",speed, distance1[playerid] ,fine[playerid]);
			SendClientMessage(playerid, VERDEFRACO, str);
			PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
		}
	}
}
public OnPlayerCommandText(playerid, cmdtext[])
      if (strcmp("/inforadar", cmdtext, true, 10) == 0)
  {
	SendClientMessage(playerid,0x33CCFFAA,"|____________INFO RADAR____________|");
	SendClientMessage(playerid,0x33CCFFAA,"Sistemul radar este un sistem foarte performant si nu poate fi pacalit.");
    SendClientMessage(playerid,0x33CCFFAA,"Limite de viteza:");
    SendClientMessage(playerid,0x33CCFFAA,"In localitate: 50 KM/H");
    SendClientMessage(playerid,0x33CCFFAA,"In afara localitatii: 90 KM/H");
    SendClientMessage(playerid,0x33CCFFAA,"Pe autostrada: 150 KM/H");
	SendClientMessage(playerid,0x33CCFFAA,"Depasirea limitei se pedepseste cu o amenda de 2000$ ");
    return 1;
	   }

va rog ajutaima sa maresc viteza

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

AddFlitsPaal(i, 1278, 1477.366089, -1725.674316, 13.093750, 40, 50);
           AddFlitsPaal(i, 1278, 1524.257935, -1703.046753, 13.093750, 40, 50); // Prefeitura
           AddFlitsPaal(i, 1278, 1092.917847, -1857.532471, 13.097494, 40, 50); // BANCO
           AddFlitsPaal(i, 1278, 1205.723633, -1857.804932, 13.093750, 40, 50); // HOSPITAL
           AddFlitsPaal(i, 1278, 1305.047485, -1830.348755, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1305.518433, -1694.936890, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1306.388184, -1554.258057, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1339.077515, -1480.506714, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1363.483276, -1330.381836, 13.085953, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1260.221436, -1144.856689, 23.203125, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1136.905029, -1144.872192, 23.203125, 40, 50); // VAGO2
           AddFlitsPaal(i, 1278, 850.989685, -1144.811401, 23.203125, 40, 50); // VAGO3
           AddFlitsPaal(i, 1278, 1321.595947, -1400.469238, 12.867904, 40, 50); // VAGO4
           AddFlitsPaal(i, 1278, 1252.426147, -1400.511963, 12.554832, 40, 50); // VAGO5
           AddFlitsPaal(i, 1278, 1121.756714, -1400.513062, 12.957708, 40, 50); // VAGO6
           AddFlitsPaal(i, 1278, 1008.723206, -1400.474365, 12.570202, 40, 50); // VAGO7
           AddFlitsPaal(i, 1278, 909.299805, -1400.526001, 12.755013, 40, 50); // VAGO8
           AddFlitsPaal(i, 1278, 758.733704, -1400.561768, 12.914063, 40, 50); // VAGO9
           AddFlitsPaal(i, 1278, 1001.455505, -964.044434, 40.831264, 40, 50); // VAGO9

Schimba ultimul 50 in ce vrei tu.

Durr durr durr...

Link to comment
Share on other sites

hmm.... am si eu o intrebare , din ce a spus Salieri am inteles ca asta e ca un radar care nu te lasa sa treci de 50 kmh in oras?

da, functioneaza cu IsPlayerInRangeOfPoint (sau PlayerToPoint) si SetVehicleVelocity cred.

exemplu:

AddFlitsPaal(i, 1278, 1524.257935, -1703.046753, 13.093750, 40, 50); // Prefeitura

i - jucatorul depistat de radar

1524.257935, -1703.046753, 13.093750 - coordonatele radarului

40 - pana la ce departare sa vina

50 - KM limita

Link to comment
Share on other sites

Am o intrebare...Unde sunt puse radarele, ca nu le gasesc niciunde:|

Proiecte:

Hospital Interior-0%(neinceput)

Limo Interior-0%(inceput)

Bank Interior-0%(neinceput)

Bus Interior-0%(inceput)

Plane Interior-0%(neinceput)

Train Interior-0%(neinceput)

Boat Interior-95%(terminat,mici retusuri)

Mini-Scripturi care au fost publicate:

GPS System: http://forum.sa-mp.ro/filter-scripts-and-gamemodes/%28fs%29-gps-system/

Link to comment
Share on other sites

Am o intrebare...Unde sunt puse radarele, ca nu le gasesc niciunde:|

AddFlitsPaal(i, 1278, 1477.366089, -1725.674316, 13.093750, 40, 50);
           AddFlitsPaal(i, 1278, 1524.257935, -1703.046753, 13.093750, 40, 50); // Prefeitura
           AddFlitsPaal(i, 1278, 1092.917847, -1857.532471, 13.097494, 40, 50); // BANCO
           AddFlitsPaal(i, 1278, 1205.723633, -1857.804932, 13.093750, 40, 50); // HOSPITAL
           AddFlitsPaal(i, 1278, 1305.047485, -1830.348755, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1305.518433, -1694.936890, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1306.388184, -1554.258057, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1339.077515, -1480.506714, 13.093750, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1363.483276, -1330.381836, 13.085953, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1260.221436, -1144.856689, 23.203125, 40, 50); // VAGO
           AddFlitsPaal(i, 1278, 1136.905029, -1144.872192, 23.203125, 40, 50); // VAGO2
           AddFlitsPaal(i, 1278, 850.989685, -1144.811401, 23.203125, 40, 50); // VAGO3
           AddFlitsPaal(i, 1278, 1321.595947, -1400.469238, 12.867904, 40, 50); // VAGO4
           AddFlitsPaal(i, 1278, 1252.426147, -1400.511963, 12.554832, 40, 50); // VAGO5
           AddFlitsPaal(i, 1278, 1121.756714, -1400.513062, 12.957708, 40, 50); // VAGO6
           AddFlitsPaal(i, 1278, 1008.723206, -1400.474365, 12.570202, 40, 50); // VAGO7
           AddFlitsPaal(i, 1278, 909.299805, -1400.526001, 12.755013, 40, 50); // VAGO8
           AddFlitsPaal(i, 1278, 758.733704, -1400.561768, 12.914063, 40, 50); // VAGO9
           AddFlitsPaal(i, 1278, 1001.455505, -964.044434, 40.831264, 40, 50); // VAGO9
al 3-lea, al 4-lea si al 5-lea parametru sunt coordonatele parametru 3 = X parametru 4 = Y parametru 5 = Z ex:
AddFlitsPaal(i, 1278, 1477.366089, -1725.674316, 13.093750, 40, 50);
coordonatele sunt:
1477.366089, -1725.674316, 13.093750

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.