Fuel system not setting correctly
#1

As the title says, I'm in the process of making a fuel system but fuel for some of the cars is being set to 0 on startup, and some are being set to -1. I think I have done everything correctly (code below) and I cant figure out whats wrong.

pawn Код:
new Fuel[MAX_VEHICLES];

//GamemodeInit
for(new i=0;i<MAX_VEHICLES;i++)
{
     Fuel[i] = 100;
}

//OnPlayerEnterVehicle
format(infostr, sizeof(infostr), "[Owner: %s]-[VIN: LVDMV-%i]-[Fuel: %i]", CarInfo[vehicleid][cOwner], vehicleid, CarInfo[vehicleid][cHouseid],Fuel[vehicleid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, infostr);
Like I said, the first car I get into after restarting the server says fuel is 0. It was a late-night addition to the script, so if I'm being a dunce and missing something let me know (kindly please )
Reply
#2

pawn Код:
new Float:Fuel[MAX_VEHICLES];

format(string, 128, "Fuel: %.0f", Fuel[GetPlayerVehicleID(i)]);
Reply
#3

It's not a problem with your fuel. You have an extra variable in your format(CarInfo[vehicleid][cHouseid]), take that out.
Reply
#4

Oh I do don't I? Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)