16.01.2015, 02:19
You are looping through whole function with "i" use vehicle id... for vehicles
EDIT:JUST SAW YOUR REPLY
EDIT2: Try that this is how i use it:
EDIT:JUST SAW YOUR REPLY
EDIT2: Try that this is how i use it:
pawn Код:
function Decreasing_Fuel()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if (isrefuelling[i]) continue;
new vid = GetPlayerVehicleID(i);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
if (GetPlayerVehicleSeat(i) == 0)
{
fuel[vid] = fuel[vid] -1;
if (fuel[vid]<1)
{
fuel[vid] = 0;
SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,3);
}
}
new string[125];format(string,sizeof string,"Vehicle Fuel:%i",fuel[vid]);
TextDrawSetString(td_fuel[i],string);
}
return 1;
}