02.12.2013, 20:40
Should I add loop here? Cuz I don't know I want to lower fuel at car for all players not only for one...
pawn Код:
public FLower(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
Carinfo[vehicleid][F] = Carinfo[vehicleid][F] - FUEL_DECREASE;
TextDrawShowForPlayer(playerid, vFuel[playerid]);
TextDrawShowForPlayer(playerid, Fuel[playerid]);
if(Carinfo[vehicleid][F] < 1)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
Carinfo[vehicleid][F] = 0;
KillTimer(GasTimer[playerid]);
GameTextForPlayer(playerid, "~r~Vehicle is out of ~w~fuel~r~!", 5000, 5);
TextDrawHideForPlayer(playerid, Veh[playerid]);
TextDrawHideForPlayer(playerid, Gear[playerid]);
TextDrawHideForPlayer(playerid, Speed[playerid]);
TextDrawHideForPlayer(playerid, HP[playerid]);
TextDrawHideForPlayer(playerid, vHP[playerid]);
TextDrawHideForPlayer(playerid, vGear[playerid]);
TextDrawHideForPlayer(playerid, vSpeed[playerid]);
TextDrawHideForPlayer(playerid, vName[playerid]);
TextDrawHideForPlayer(playerid, Fuel[playerid]);
TextDrawHideForPlayer(playerid, vFuel[playerid]);
}
if(Carinfo[vehicleid][F] > 95) TextDrawSetString(vFuel[playerid]," ~g~~n~lllll~n~~y~~h~lllll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 90 && Carinfo[vehicleid][F] < 95) TextDrawSetString(vFuel[playerid], " ~g~~n~llll~n~~y~~h~lllll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 85 && Carinfo[vehicleid][F] < 90) TextDrawSetString(vFuel[playerid], " ~g~~n~lll~n~~y~~h~lllll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 80 && Carinfo[vehicleid][F] < 85) TextDrawSetString(vFuel[playerid], " ~g~~n~ll~n~~y~~h~lllll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 75 && Carinfo[vehicleid][F] < 80) TextDrawSetString(vFuel[playerid], " ~g~~n~l~n~~y~~h~lllll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 70 && Carinfo[vehicleid][F] < 75) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~h~lllll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 65 && Carinfo[vehicleid][F] < 70) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~h~llll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 60 && Carinfo[vehicleid][F] < 65) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~h~lll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 55 && Carinfo[vehicleid][F] < 60) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~h~ll~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 50 && Carinfo[vehicleid][F] < 55) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~h~l~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 45 && Carinfo[vehicleid][F] < 50) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~n~lllll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 40 && Carinfo[vehicleid][F] < 45) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~n~llll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 35 && Carinfo[vehicleid][F] < 40) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~n~lll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 30 && Carinfo[vehicleid][F] < 35) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~n~ll~n~~r~lllll");
if(Carinfo[vehicleid][F] > 25 && Carinfo[vehicleid][F] < 30) TextDrawSetString(vFuel[playerid], " ~n~~n~~y~~n~l~n~~r~lllll");
if(Carinfo[vehicleid][F] > 20 && Carinfo[vehicleid][F] < 25) TextDrawSetString(vFuel[playerid], " ~n~~n~~n~~n~~r~lllll");
if(Carinfo[vehicleid][F] > 15 && Carinfo[vehicleid][F] < 20) TextDrawSetString(vFuel[playerid], " ~n~~n~~n~~n~~r~llll");
if(Carinfo[vehicleid][F] > 10 && Carinfo[vehicleid][F] < 15) TextDrawSetString(vFuel[playerid], " ~n~~n~~n~~n~~r~lll");
if(Carinfo[vehicleid][F] > 5 && Carinfo[vehicleid][F] < 10) TextDrawSetString(vFuel[playerid], " ~n~~n~~n~~n~~r~ll");
if(Carinfo[vehicleid][F] > 1 && Carinfo[vehicleid][F] < 5) TextDrawSetString(vFuel[playerid], " ~n~~n~~n~~n~~r~l");
if(Carinfo[vehicleid][F] < 1) TextDrawSetString(vFuel[playerid], " ~n~~n~~n~~n~~r~|");
return 1;
}