Cand a picat ultima data a picat si imi arata pe ecran FARA BENZINA
Aceasta este la FARA BENZINA
function CheckGas() {
new engine,lights,alarm,doors,bonnet,boot,objective;
foreach(Player,i) {
if(GetPlayerState(i) == PLAYER_STATE_DRIVER) {
new vehicle = GetPlayerVehicleID(i), query[256];
if(Gas[vehicle] >= 1) {
if(vehEngine[vehicle] == 1) {
if(IsAPlane(vehicle) || IsABoat(vehicle) || IsABike2(vehicle) || ExamCar == vehicle || JobVehicle == vehicle) { Gas[vehicle]++; }
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) {
CarInfo[carid][KM] += (spe*0.27)/100;
format(query, sizeof(query), "UPDATE `cars` SET `KM`='%f' WHERE `ID`='%d'", CarInfo[carid][KM], carid);
mysql_query(SQL, query);
}
}
}
}
else if(!IsAFLYCar(vehicle)) {
NoFuel = 1;
TogglePlayerControllable(i, 0);
GameTextForPlayer(i,"Fara benzina",1500,3);
vehEngine[vehicle] = 0;
GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(i, "Engine", 0);
}
}
}
return 1;
}