27.06.2015, 21:23
So basically why saving the vehicle fuel every 30 seconds while it did already save? Here is a small check.
Код:
native IsValidVehicle(vehicleid); static bool:V_cansave[MAX_VEHICLES char]; public FuelUpdate() { for (new i = 0; i != MAX_VEHICLES; i++) { if (!IsValidVehicle(i)) continue; new engine, lights, alarm, doors, bonnet, boot, objective ; GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective); if (engine) { if (VehFuel[i] > 0) { V_cansave{i} = true; VehFuel[i]--; } if (!VehFuel[i]) { SetVehicleParamsEx(i, 0, lights, alarm, doors, bonnet, boot, objective); if (VehicleSQLID[i] > 0) { if (V_cansave{i}) { V_cansave{i} = false; MySQL_SetInteger(VehicleSQLID[i], "VehFuel", 0, "vehicles"); } } } } } }