Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. function CheckGas()
  2. {
  3. new engine, lights, alarm, doors, bonnet, boot, objective;
  4.  
  5. foreach(new i : Player)
  6. {
  7. if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
  8. {
  9. new vehicle = GetPlayerVehicleID(i), query[128];
  10.  
  11. if(Gas[vehicle] >= 1)
  12. {
  13. if(vehEngine[vehicle] == 1)
  14. {
  15. if(IsAPlane(vehicle) || IsABoat(vehicle) || IsABike2(vehicle) || ExamCar[i] == vehicle || JobVehicle[i] == vehicle) { Gas[vehicle]++; }
  16.  
  17. if(!IsPlayerPaused(i)) Gas[vehicle]--;
  18.  
  19. new carid = FindSpawnID(vehicle);
  20.  
  21. if(CarInfo[carid][cID] != -2 && carid != 0)
  22. {
  23. new spe = Carspeed(i);
  24.  
  25. if(spe > 5 && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerVehicleID(i) == vehicle && !IsPlayerPaused(i))
  26. {
  27. CarInfo[carid][KM] += (spe * 0.27) / 100;
  28.  
  29. mysql_format(SQL, query, sizeof query, "UPDATE `cars` SET `KM` = '%f' WHERE `ID` = '%d'", CarInfo[carid][KM], carid);
  30. mysql_tquery(SQL, query, "", "");
  31. }
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement