01.09.2013, 11:50
pawn Код:
forward timer_fuel_lower(playerid);
pawn Код:
public timer_fuel_lower(playerid)
{
if(isrefuelling[playerid]) continue;
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(GetPlayerVehicleID(vid),engine,lights,alarm,doors,bonnet,boot,objective);
if(engine>=1)
{
if(fuel[playerid] >= 1)
{
fuel[playerid]--;
}
else if (fuel[vid]<1)
{
fuel[vid] = 0;
SetVehicleParamsEx(vid,false,0,0,0,0,0,0);
if(IsPlayerInVehicle(playerid, vid))
{
GameTextForPlayer(playerid,"~r~The vehicle ran out of ~w~fuel~r~!",5000,4);
}
}
}
new string[125];format(string,sizeof string,"Fuel: ~r~%i~g~ pcnt",fuel[vid]);
TextDrawSetString(td_fuel[playerid],string);
return 1;
}