View Single Post
Old 14/02/2020, 03:13 PM   #1
Eyex
Little Clucker
 
Join Date: May 2019
Posts: 16
Reputation: 0
Default Speedometer meter distance Help

Hy Guys. My speedometer and fuel gauge are fine. But on the other hand the distance meter does not work does not count. Can someone help me?

Code:
v Enum
{
   Float: FUTOTTKM,
Code:
public KMIdozito()
{

	for(new i; i < MAX_PLAYERS; i ++)
	{
		if(IsPlayerConnected(i))
		{
		    new VehID = GetPlayerVehicleID( i );
		    if(VehID >= 200)
		    {
				if(IsPlayerInAnyVehicle(i) && !GetPlayerVehicleSeat(i))
				{
				    new Float:kmszamit;
				    kmszamit = GetVehicleSpeed(VehID)*0.001;
					vInfo[VehID][FUTOTTKM] += kmszamit;

					vInfo[VehID][olajcserekm] += kmszamit;

					SaveVehicle(VehID);
				}
			}
		}
	}
}
Code:
Uzemanyagtext[playerid] = CreatePlayerTextDraw(playerid, 526.000000, 369.000000, "Sebesség: %dkm/h\nÜzemanyag: %d l\nFutottKM: %.3f");
	PlayerTextDrawBackgroundColor(playerid, Uzemanyagtext[playerid], 255);
	PlayerTextDrawFont(playerid, Uzemanyagtext[playerid], 1);
	PlayerTextDrawLetterSize(playerid, Uzemanyagtext[playerid], 0.230000, 1.100000);
	PlayerTextDrawColor(playerid, Uzemanyagtext[playerid], -1);//-16776961
	PlayerTextDrawSetOutline(playerid, Uzemanyagtext[playerid], 1);
	PlayerTextDrawSetProportional(playerid, Uzemanyagtext[playerid], 1);
	PlayerTextDrawUseBox(playerid, Uzemanyagtext[playerid], 1);
	PlayerTextDrawBoxColor(playerid, Uzemanyagtext[playerid], 102);
	PlayerTextDrawTextSize(playerid, Uzemanyagtext[playerid], 611.000000, -10.000000);
/////////////////////////////////////////////////

Code:
public KocsiText()
{
	new Float: elet, vehicleid, uzemanyag[50];
	new S[256];

	for(new player; player < MAX_PLAYERS; player++)
	{
	    if( IsPlayerConnected(player))
	    {
			if(IsPlayerInAnyVehicle(player))
			{
				vehicleid = GetPlayerVehicleID(player);
				GetVehicleHealth(vehicleid, elet);

	   	    	GetVehicleHealth(vehicleid, elet);
		    	if(elet < 300) return KocsiOff(vehicleid);

				switch(vInfo[vehicleid][UZEMANYAGTIPUS])
				{
					case BENZIN: { uzemanyag = "Benzin"; }
					case DIESEL: { uzemanyag = "Diesel"; }
				}
				if(vInfo[vehicleid][UZEMANYAGTIPUS] > 0)
				{
	                format(S, sizeof(S), "%s: ~y~%dkm/h~w~~n~%s: ~y~%d l~w~~n~%s: ~y~%.3f~w~", FixGameString("Sebesség"), GetVehicleSpeed(vehicleid), uzemanyag, vInfo[vehicleid][UZEMANYAG], FixGameString("FutottKM"), vInfo[vehicleid][FUTOTTKM]);
					if(vInfo[vehicleid][UZEMANYAGTIPUS] != vInfo[vehicleid][UZEMANYAGTIPUSVAN]) format(S, sizeof(S), "%s: ~r~%dkm/h~w~~n~N/A: ~g~%d l~w~~n~%s: ~y~%.3f~w~", FixGameString("Sebesség"), GetVehicleSpeed(vehicleid), vInfo[vehicleid][UZEMANYAG], FixGameString("FutottKM"), vInfo[vehicleid][FUTOTTKM]);
	   			}
				else
				{
					format(S, sizeof(S), "%s ~y~%dkm/h~w~", FixGameString("Sebesség:"), GetVehicleSpeed(vehicleid) );
				}

				PlayerTextDrawSetString(player, Uzemanyagtext[player], S);
			}
		}
	}

	return 1;
}
//////////////////

Code:
stock SaveVehicle( vehicleid )
{
		if(vehicleid > 210 )
		{
		    if(!dini_Exists(vehicleFile(vehicleid)))
		    {
		        dini_Remove(vehicleFile(vehicleid));
		        dini_Create( vehicleFile(vehicleid) );
		    }
		    else
		    {
		        dini_Create( vehicleFile(vehicleid) );
		    }

		}

		dini_IntSet( vehicleFile(vehicleid), "MODEL", vInfo[vehicleid][MODEL] );
	    dini_FloatSet( vehicleFile(vehicleid), "X", vInfo[vehicleid][X] );
	    dini_FloatSet( vehicleFile(vehicleid), "Y", vInfo[vehicleid][Y] );
	    dini_FloatSet( vehicleFile(vehicleid), "Z", vInfo[vehicleid][Z] );
	    dini_FloatSet( vehicleFile(vehicleid), "A", vInfo[vehicleid][A] );
	    dini_Set( vehicleFile(vehicleid), "OWNER", vInfo[vehicleid][OWNER] );
	    dini_Set( vehicleFile(vehicleid), "COOWNER", vInfo[vehicleid][COOWNER] );
	    dini_IntSet( vehicleFile(vehicleid), "COLOR", vInfo[vehicleid][COLOR] );
	    dini_IntSet( vehicleFile(vehicleid), "COLOR2", vInfo[vehicleid][COLOR2] );
	    dini_IntSet( vehicleFile(vehicleid), "SOLD", vInfo[vehicleid][SOLD] );
	    dini_IntSet( vehicleFile(vehicleid), "INT", vInfo[vehicleid][INT] );
	    dini_IntSet( vehicleFile(vehicleid), "VW", vInfo[vehicleid][VW] );
	    dini_Set( vehicleFile(vehicleid), "PLATE", vInfo[vehicleid][PLATE] );
	    dini_IntSet( vehicleFile(vehicleid), "PRICE", vInfo[vehicleid][PRICE] );
	    dini_IntSet( vehicleFile(vehicleid), "LOCKED", vInfo[vehicleid][LOCKED] );
	    dini_IntSet(vehicleFile(vehicleid), "ÜzemanyagTipus", vInfo[vehicleid][UZEMANYAGTIPUS]);
		dini_IntSet(vehicleFile(vehicleid), "MilyenVanBenne", vInfo[vehicleid][UZEMANYAGTIPUSVAN]);
		dini_IntSet(vehicleFile(vehicleid), "MaxÜzemAnyag", vInfo[vehicleid][MAXUZEMANYAG]);
		dini_IntSet(vehicleFile(vehicleid), "ÜzemAnyag", vInfo[vehicleid][UZEMANYAG]);
		dini_IntSet(vehicleFile(vehicleid), "KerékBilincs", vInfo[vehicleid][KEREKBILINCS]);
		dini_IntSet(vehicleFile(vehicleid), "Lefoglalva", vInfo[vehicleid][LEFOGLALVA]);
		dini_IntSet(vehicleFile(vehicleid), "SPOILER", vInfo[vehicleid][SPOILER]);
		dini_FloatSet( vehicleFile(vehicleid), "FUTOTTKM", vInfo[vehicleid][FUTOTTKM] );
		dini_FloatSet( vehicleFile(vehicleid), "OLAJCSEREKM", vInfo[vehicleid][olajcserekm] );
Eyex is offline   Reply With Quote