SA-MP Forums Archive
[Ajuda]Sistema de Blindagem +REP - 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]Sistema de Blindagem +REP (/showthread.php?tid=336065)



[Ajuda]Sistema de Blindagem +REP - Urubu_Rei - 21.04.2012

Olб pessoal, eu queria que o meu sistema de blindagem fosse assim>
No velocimetro> mostrasse Blindagem e Lataria para todos os carros.
sу que sу os carros das orgs que eu quiser vai mostrar blindagem 100% e pros que nгo tem blindagem vai mostrar 0%
os carros que tem blindagem vai gastar primeiro a blindagem atй chegar no 0% dai vai comeзar a gastar a lataria.
E sу um lugar para qualquer um poder blindar que pague mil reais pela blindagem.

Codes do meu velocimetro:

Код:
public VeloThiago()
{
    new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
	new Float:Speedo_HP;
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    new vehicle = GetPlayerVehicleID(i);
	    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
		{
		    GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
			GetPlayerVehicleID(i);
			new newcar = GetPlayerVehicleID(i);
			GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
			new str1[256],str2[256],str3[256],str4[256],str5[256],str6[256],str7[256];
			if(SpeedoON[i] == 0)
			{
				TextDrawShowForPlayer(i, box[i]);
				TextDrawShowForPlayer(i, fahrzeug[i]);
				TextDrawShowForPlayer(i, mph[i]);
				TextDrawShowForPlayer(i, combustivelt[i]);
				TextDrawShowForPlayer(i, zustand[i]);
				TextDrawShowForPlayer(i, gps[i]);
				TextDrawShowForPlayer(i, hoehe[i]);
				TextDrawShowForPlayer(i, url[i]);
				SpeedoON[i] = 1;
			}
			format(str1,sizeof(str1),"~w~~d~Veiculo: ~b~~h~~h~%s",vehName[GetVehicleModel(vehicle)-400]);
			TextDrawSetString(fahrzeug[i], str1);
			format(str2,sizeof(str2),"~w~~d~KM/H: ~y~%d",GetPlayerSpeed(i, true));
			TextDrawSetString(mph[i], str2);
			format(str3,sizeof(str3),"~w~~d~Combustivel: ~g~~h~%d%%", Gas[vehicle]);
			TextDrawSetString(combustivelt[i], str3);
			if(IsACopCar(newcar) || IsAExCar(newcar) || IsAnAmbulanceCar(newcar) || IsAPoliciaCivilCar(newcar) || IsAPFCar(newcar) || IsABOPEsCar(newcar) || IsAGOVCar(newcar))
			{
			format(str4,sizeof(str4),"~w~~d~Blindagem: ~r~~h~Sim");
			}
			else
			{
			format(str4,sizeof(str4),"~w~~d~Lataria: ~r~~h~%0.0f%%", Speedo_HP/10);
			}
			TextDrawSetString(zustand[i], str4);
			format(str5,sizeof(str5),"~w~~d~GPS: ~p~~h~%s", ReturnPlayerZone(i));
			TextDrawSetString(gps[i], str5);
			format(str6,sizeof(str6),"~w~~d~Altura: ~p~~h~%.1f", Speedo_Z);
			TextDrawSetString(hoehe[i], str6);
			format(str7,sizeof(str7),URLRAPHAEL);
			TextDrawSetString(url[i], str7);
		}
		SavePlayerPos[i][sX] = Speedo_X, SavePlayerPos[i][sY] = Speedo_Y, SavePlayerPos[i][sZ] = Speedo_Z;
	}
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(!IsPlayerInAnyVehicle(i))
		{
            TextDrawHideForPlayer(i, box[i]);
			TextDrawHideForPlayer(i, fahrzeug[i]);
			TextDrawHideForPlayer(i, mph[i]);
			TextDrawHideForPlayer(i, combustivelt[i]);
			TextDrawHideForPlayer(i, zustand[i]);
			TextDrawHideForPlayer(i, gps[i]);
			TextDrawHideForPlayer(i, hoehe[i]);
			TextDrawHideForPlayer(i, url[i]);
			SpeedoON[i] = 0;
		}
		if(spawnado[i] == 1)
		{
			if(SpeedoON[i] >= 1)
			{
				TextDrawHideForPlayer(i, forum[i]);
			}
			if(SpeedoON[i] <= 0)
			{
				TextDrawShowForPlayer(i, forum[i]);
			}
		}
	}
}
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	new newcar = vehicleid; 
    if(IsACopCar(newcar) || IsAExCar(newcar) || IsAnAmbulanceCar(newcar) || IsAPoliciaCivilCar(newcar) || IsAPFCar(newcar) || IsABOPEsCar(newcar) || IsAGOVCar(newcar))
	{
		Blindado[vehicleid] = true;
	}
	new string[256];
	format(string, sizeof(string), "* %s Entra no veiculo.", PlayerName(playerid));
	ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
 	if(Trancado[vehicleid] >= 1)
	{
	    if(PlayerInfo[playerid][pAdmin] > 0 || ispassenger) { }
		else
		{
        	new Float:x,Float:y,Float:z,Float:a;
    		GetPlayerPos(playerid,x,y,z);
    		GetPlayerFacingAngle(playerid,a);
   	 		SetPlayerPos(playerid, x, y, z+0.3);
			SetPlayerFacingAngle(playerid, a);
     		SendClientMessage(playerid, COLOR_YELLOW, "Veiculo Trancado!");
     	}
	}
	return true;
}
Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
	Blindagem(vehicleid, 2000.0);
	return 1;
}
stock Blindagem(carro, Float:vida) {
	return ((Blindado[carro] && GetVehicleHealth(carro, vida) < 1000.0) ? (SetVehicleHealth(carro, vida), Blindado[carro] = false):(false));
}
Eu agradeзo muito por quem me ajudar, muito obrigado mesmo !!!!!!!!!