For some reason, when I'm in a vehicle, my TD doesn't show.
The TD called VehicleInfo[i].
It should, and it was, but now, for some reason it isnt.
No, I did now use textdrawhideforplayer.
pawn Код:
function Speedo()
{
foreach(Player,i)
{
if(IsPlayerInAnyVehicle(i))
{
static CCon[4],VehicleStats[500];
if(PInfo[i][CCOn] == 1) CCon = "Yes";
else CCon = "No";
if(IsTrolley(GetPlayerVehicleID(i)))
{
format(VehicleStats,sizeof VehicleStats,"~b~~h~Speed: ~r~~h~%i km ~n~~b~~h~CC: ~r~~h~%s ~n~~y~~h~Trolley",GetVehicleSpeed(GetPlayerVehicleID(i)),CCon);
TextDrawSetString(VehicleInfo[i],VehicleStats);
TextDrawShowForPlayer(i,VehicleInfo[i]);
}
else if(BagID[i] != -1 || TrashID[i] != -1)
{
static Float:dis;
if(BagID[i] != -1)
{
if(BagPos[i][0] == -1867.3479) dis = PointBetweenPlayer(i,-1889.7179,832.5801,35.0156);
else dis = PointBetweenPlayer(i,BagPos[i][0],BagPos[i][1],BagPos[i][2]);
}
else if(TrashID[i] != -1)
{
if(TrashPos[i][0] == -1867.3479) dis = PointBetweenPlayer(i,-1867.3479,-1672.3749,21.7500);
else dis = PointBetweenPlayer(i,TrashPos[i][0],TrashPos[i][1],TrashPos[i][2]);
}
format(VehicleStats,sizeof VehicleStats,"~b~~h~Time left: ~r~~h~%i:%i ~n~~b~~h~Distance: ~r~~h~%i Meters~n~~b~~h~Speed: ~r~~h~%i km/h ~n~~b~~h~CC: ~r~~h~%s ~n~~y~~h~%s",MissionMins[i],MissionSeconds[i],floatround(dis),GetVehicleSpeed(GetPlayerVehicleID(i)),CCon,GetVehicleName(GetPlayerVehicleID(i)));
TextDrawSetString(VehicleInfo[i],VehicleStats);
TextDrawShowForPlayer(i,VehicleInfo[i]);
}
else
{
format(VehicleStats,sizeof VehicleStats,"~b~~h~Speed: ~r~~h~%i km/h ~n~~b~~h~CC: ~r~~h~%s ~n~~y~~h~%s",GetVehicleSpeed(GetPlayerVehicleID(i)),CCon,GetVehicleName(GetPlayerVehicleID(i)));
TextDrawSetString(VehicleInfo[i],VehicleStats);
TextDrawShowForPlayer(i,VehicleInfo[i]);
}
}
if(!IsPlayerInAnyVehicle(i))
{
IsPlayerExtinguishingFire(i);
}
}
}