Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CheckGas()
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- foreach(new i : Player)
- {
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- new vehicle = GetPlayerVehicleID(i), query[128];
- if(Gas[vehicle] >= 1)
- {
- if(vehEngine[vehicle] == 1)
- {
- if(IsAPlane(vehicle) || IsABoat(vehicle) || IsABike2(vehicle) || ExamCar[i] == vehicle || JobVehicle[i] == vehicle) { Gas[vehicle]++; }
- if(!IsPlayerPaused(i)) Gas[vehicle]--;
- new carid = FindSpawnID(vehicle);
- if(CarInfo[carid][cID] != -2 && carid != 0)
- {
- new spe = Carspeed(i);
- if(spe > 5 && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(i) == vehicle && !IsPlayerPaused(i))
- {
- CarInfo[carid][KM] += (spe * 0.27) / 100;
- mysql_format(SQL, query, sizeof query, "UPDATE `cars` SET `KM` = '%f' WHERE `ID` = '%d'", CarInfo[carid][KM], carid);
- mysql_tquery(SQL, query, "", "");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement