15.06.2014, 23:17
instead of making FuelPercent = FuelPercent0 *100 makesomething like this:
FuelPercent = (CarInfo[idx][Fuel]*100)/CarInfo[idx][MaxFuel];
and forget the FuelPercent0 variable. Simply becasue you're using integer when making a division. The value of FuelPercent0 would always be under 1, something like 0.3431321 but since you're not using a float it will always be 0. So either make:
new Float:FuelPercent0
or do the thing I said above, that way you don't need a float because it will give an integer, because you multiply by 100 before dividing
FuelPercent = (CarInfo[idx][Fuel]*100)/CarInfo[idx][MaxFuel];
and forget the FuelPercent0 variable. Simply becasue you're using integer when making a division. The value of FuelPercent0 would always be under 1, something like 0.3431321 but since you're not using a float it will always be 0. So either make:
new Float:FuelPercent0
or do the thing I said above, that way you don't need a float because it will give an integer, because you multiply by 100 before dividing