30.10.2011, 12:50
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),"~y~Veiculo:~n~~r~%s~ n~~g~Velocidade:~r~ %d KM/h~n~~y~Combustivel: ~r~%d%%~n~~g~Lataria: ~W~%0.0f%%~n~~y~Localizacao:~n~~r~%s ~n~~r~Brasil~b~Game" ,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;
}
}
}
}
{
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),"~y~Veiculo:~n~~r~%s~ n~~g~Velocidade:~r~ %d KM/h~n~~y~Combustivel: ~r~%d%%~n~~g~Lataria: ~W~%0.0f%%~n~~y~Localizacao:~n~~r~%s ~n~~r~Brasil~b~Game" ,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;
}
}
}
}