08.06.2013, 10:56
the fuel bar dissapear too.
Код:
public OnPlayerUpdate(playerid)
{
new
Float:fPos[3],
Float:Pos[4][2],
Float:fSpeed;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);
fSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) +
floatpower(fPos[2], 2)) * 200;
new Float:alpha = 320 - fSpeed;
if(alpha < 60)
alpha = 60;
for(new i; i < 4; i++)
{
TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
TextDrawDestroy(TextDrawsd[playerid][i]);
GetDotXY(548, 401, Pos[i][0], Pos[i][1], alpha, (i + 1) * 8);
TextDrawsd[playerid][i] = TextDrawCreate(Pos[i][0], Pos[i][1], "~b~.");
TextDrawLetterSize(TextDrawsd[playerid][i], 0.73, -2.60);
TextDrawSetOutline(TextDrawsd[playerid][i], 0);
TextDrawSetShadow(TextDrawsd[playerid][i], 1);
TextDrawShowForPlayer(playerid, TextDrawsd[playerid][i]);
}
new szString[128];
TextDrawHideForPlayer(playerid, GPSText[playerid]);
TextDrawDestroy(GPSText[playerid]);
format(szString, 128, "%s", GetPlayerArea(playerid));
GPSText[playerid] = TextDrawCreate(507.000000, 423.000000, szString);
TextDrawBackgroundColor(GPSText[playerid], 255);
TextDrawFont(GPSText[playerid], 1);
TextDrawLetterSize(GPSText[playerid], 0.320000, 1.500000);
TextDrawColor(GPSText[playerid], -16776961);
TextDrawSetOutline(GPSText[playerid], 0);
TextDrawSetProportional(GPSText[playerid], 1);
TextDrawSetShadow(GPSText[playerid], 1);
TextDrawShowForPlayer(playerid, GPSText[playerid]);
// Fuel
SetProgressBarValue(GasBar[playerid], Gas[GetPlayerVehicleID(playerid)]);
UpdateProgressBar(GasBar[playerid], playerid);
}
return 1;
}

