SA-MP Forums Archive
[Ajuda] trocar o velocimetro - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] trocar o velocimetro (/showthread.php?tid=510553)



trocar o velocimetro - igor97m - 01.05.2014

Ola gente eu gostaria de pedir ajuda para mim trocar o velocнmetro do meu server eu nгo sei como trocar sempre dar erro :/

velocimetro atual!


e o que eu quero por!


Codigos do velocimetro atual!
Код:
public Velocimetro()
{
	new Float:Speedo_HP;
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(gPlayerLogged[i] == 1 && IsPlayerInAnyVehicle(i))
		{
		    new vehicle = GetPlayerVehicleID(i);
		    GetVehicleHealth(vehicle, Speedo_HP);
			new string[256];
			format(string,sizeof(string),"~r~Veiculo:~n~~b~%s~n~~r~Velocidade:~b~ %d KM/h~n~~r~Combustivel: ~b~%d%%~n~~r~Lataria: ~b~%0.0f%%~n~~r~Localizacao:~n~~b~%s" ,vehName[GetVehicleModel(vehicle)-400], GetPlayerSpeed(i, true), Gas[vehicle], Speedo_HP/10, ReturnPlayerZone(i));
			TextDrawSetString(Speed[i], string);
			if(TextShow[i] == false)
			{
				TextDrawShowForPlayer(i, Speed[i]);
				TextShow[i] = true;
			}
		}
		else
		{
		    if(TextShow[i] == true)
		    {
            	TextDrawHideForPlayer(i, Speed[i]);
				TextShow[i] = false;
			}
		}
	}
}
Codigos do velocimetro que eu quero!

Код:
public AtualizarVeloLeo(playerid)
{
    new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
	new Float:PlayerSpeedDistance,value;
	new Float:Speedo_HP;
	new Float:Speedo_HPP;


	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
		{
		    GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
			GetPlayerVehicleID(i);
			GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
			GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HPP);
			PlayerSpeedDistance = floatsqroot(floatpower(floatabs(floatsub(Speedo_X,SavePlayerPosV[i][sX])),2)+floatpower(floatabs(floatsub(Speedo_Y,SavePlayerPosV[i][sY])),2)+floatpower(floatabs(floatsub(Speedo_Z,SavePlayerPosV[i][sZ])),2));
			value = floatround(PlayerSpeedDistance * 5000);
			new vehicle = GetPlayerVehicleID(i);
			new str1[256],str2[256],str3[256],str4[256],str6[256];
			if(SpeedoON[i] == 0)
			{
				TextDrawShowForPlayer(i, box[i]);
				TextDrawShowForPlayer(i, fahrzeug[i]);
				TextDrawShowForPlayer(i, kmh[i]);
				TextDrawShowForPlayer(i, hoehe[i]);
				TextDrawShowForPlayer(i, zustand[i]);
				TextDrawShowForPlayer(i, url[i]);
				TextDrawShowForPlayer(i, blindagem[i]);
				SpeedoON[i] = 1;
			}
			new kmh_anzahl = floatround(value/1600);
			format(str1,sizeof(str1),"~d~Veiculo: ~p~%s            ~n~~n~~n~       ",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
			TextDrawSetString(fahrzeug[i], str1);
            if(kmh_anzahl >= 160)
			{
				format(str2,sizeof(str2),"~d~KM/H: ~g~%d",kmh_anzahl);
				TextDrawSetString(kmh[i], str2);
			}
			else if(kmh_anzahl >= 100)
			{
                format(str2,sizeof(str2),"~d~KM/H: ~g~%d",kmh_anzahl);
				TextDrawSetString(kmh[i], str2);
			}
			else if(kmh_anzahl >= 50)
			{
                format(str2,sizeof(str2),"~d~KM/H: ~g~%d",kmh_anzahl);
				TextDrawSetString(kmh[i], str2);
			}
			else
			{
                format(str2,sizeof(str2),"~d~KM/H: ~g~%d",kmh_anzahl);
				TextDrawSetString(kmh[i], str2);
			}

			format(str3,sizeof(str3),"~d~Combustivel: ~p~%d%", Gas[vehicle]);
			TextDrawSetString(hoehe[i], str3);

			if(Speedo_HP >= 551)
			{
				format(str4,sizeof(str4),"~d~Lataria: ~y~%0.0f%%", Speedo_HP/10);
				TextDrawSetString(zustand[i], str4);
			}
			else if(Speedo_HP >= 361)
			{
                format(str4,sizeof(str4),"~d~Lataria: ~y~%0.0f%%", Speedo_HP/10);
				TextDrawSetString(zustand[i], str4);
			}
			else if(Speedo_HP >= 250)
			{
                format(str4,sizeof(str4),"~d~Lataria: ~y~%0.0f%%", Speedo_HP/10);
				TextDrawSetString(zustand[i], str4);
			}
			else
			{
                format(str4,sizeof(str4),"~d~Lataria: ~y~%0.0f%%", Speedo_HP/10);
				TextDrawSetString(zustand[i], str4);
			}
			if(Speedo_HP >= 551)
			{
				format(str6,sizeof(str6),"~d~Blindagem: ~r~~h~%d%%", Vuln[vehicle]);
				TextDrawSetString(blindagem[i], str6);
				}
			TextDrawSetString(url[i], URL);
		}
		SavePlayerPosV[i][sX] = Speedo_X, SavePlayerPosV[i][sY] = Speedo_Y, SavePlayerPosV[i][sZ] = Speedo_Z;
	}
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(!IsPlayerInAnyVehicle(i))
		{
            TextDrawHideForPlayer(i, box[i]); TextDrawHideForPlayer(i, tacho[i]); TextDrawHideForPlayer(i, fahrzeug[i]); TextDrawHideForPlayer(i, kmh[i]);
            TextDrawHideForPlayer(i, hoehe[i]); TextDrawHideForPlayer(i, zustand[i]); TextDrawHideForPlayer(i, url[i]); TextDrawHideForPlayer(i, blindagem[i]);
			SpeedoON[i] = 0;
		}
	}
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(spawnado[i] == 1)
			{
				if(SpeedoON[i] == 1)
				{
				TextDrawHideForPlayer(i, forum[i]);
				}
				if(SpeedoON[i] == 0)
				{
				TextDrawShowForPlayer(i, forum[i]);
				}
			}
		}
	}
}
caso ajude mais o velocнmetro que eu quero tem na gm do Brasil Play Script 4.8 sу que nao consigo pegar ele :/ da erro.

se poderem me ajudar agradeзo