11.08.2013, 12:16
Okay hello,
Im creating a textdraw wich is being checked every second... If its faulty its being removed. But now it does that also when its not faulty. This is my OnPlayerStateChange where its Showing up
This is the CheckValidTextDraws wich removes it after 1 sec.
Why is it getting removed? D:
Im creating a textdraw wich is being checked every second... If its faulty its being removed. But now it does that also when its not faulty. This is my OnPlayerStateChange where its Showing up
pawn Код:
if(APlayerData[playerid][PlayerClass] == ClassPolice)
{
new vehid = GetPlayerVehicleID (playerid);
if (VehRadarID [vehid] > -1) return 1;
new Float: x, Float: y, Float: z, Float: a;
GetVehiclePos (vehid, x, y, z);
GetVehicleZAngle (vehid, a);
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerInVehicle (i, vehid))
{
TextDrawShowForPlayer (i, RadarHud);
}
}
if (VehRadarID [vehid] == -1) return 1;
CheckingSpeed [vehid] = SetTimerEx ("UpdateSpeed", 100, 1, "d", vehid);
}
pawn Код:
public CheckValidTextDraws()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected (i))
{
if (IsPlayerInAnyVehicle (i))
{
new vehid = GetPlayerVehicleID (i);
if (VehRadarID [vehid] > -1)
{
TextDrawShowForPlayer (i, RadarHud);
if (CheckingSpeed [vehid] > 0)
{
TextDrawShowForPlayer (i, SpeedAndModel [vehid]);
}
else
{
TextDrawHideForPlayer (i, SpeedAndModel [vehid]);
}
}
else
{
TextDrawHideForPlayer (i, RadarHud);
}
}
else
{
TextDrawHideForPlayer (i, RadarHud);
TextDrawHideForPlayer (i, SpeedAndModel [OldVehID[i]]);
OldVehID [i] = 0;
}
}
}
return 1;
}