24.06.2010, 22:41
galera eu criei esse sistema de velocimetro:
Porem na parte da gasolina e na parte da vida do carro se outra pessoa entra em outro carro qualquer aparece a gasolina e a vida do meu carro. Como eu resolvo isso? me ajudem por favor.
Ps eu ja tentei de tudo para arrumar + sempre buga a gasolina e a vida do carro.
pawn Код:
public velocimetro(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
/*if(IsPlayerInAnyVehicle(playerid))
*/
new Float:health;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
new mtextT[20];
if(health > 950) { mtextT = "~b~-----------"; }
else if(health > 900 && health < 949) { mtextT = "~b~----------~y~-"; }//2
else if(health > 850 && health < 899) { mtextT = "~b~---------~y~--"; }//3
else if(health > 800 && health < 849) { mtextT = "~b~--------~y~---"; }//4
else if(health > 750 && health < 799) { mtextT = "~b~-------~y~----"; }//5
else if(health > 700 && health < 749) { mtextT = "~b~------~y~-----"; }//6
else if(health > 650 && health < 699) { mtextT = "~b~-----~y~------"; }//7
else if(health > 600 && health < 649) { mtextT = "~b~----~y~-------"; }//8
else if(health > 550 && health < 699) { mtextT = "~b~---~y~--------"; }//9
else if(health > 500 && health < 549) { mtextT = "~b~--~y~---------"; }//10
else if(health > 450 && health < 499) { mtextT = "~b~-~y~----------"; }//11
else if(health < 400) { mtextT = "~r~VAI EXPLODIR"; }
new string[150];
new carro;
carro = GetPlayerVehicleID(playerid);
format(string, sizeof string, "~g~Veiculo: ~w~%s ~n~~g~Local: ~w~%s~n~~g~Vida do carro: ~w~%s~n~~g~Combustivel: ~w~%d",VehiclesName[GetVehicleModel(veh)-400] , ReturnPlayerZone(playerid), mtextT, Gas[carro]);
TextDrawSetString(TextdrawVH, string);
TextDrawShowForPlayer(i, TextdrawVH);
}
else{TextDrawHideForPlayer(i, TextdrawVH);}
}
//else{TextDrawHideForPlayer(i, TextdrawVH);); }
return 1;
}
Ps eu ja tentei de tudo para arrumar + sempre buga a gasolina e a vida do carro.