Jump to content
  • 0

Problema NRG


Popescu413

Question

3 answers to this question

Recommended Posts

  • 0
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) || ExamCar[i] == vehicle || JobVehicle[i] == 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[i] = 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;
}

 

Edited by MiritaXD
Link to comment
Share on other sites

  • 0
La 07.01.2019 la 11:24, Popescu413 a spus:

Mersi , a aparut o problema , nu mai pot merge in fata cu orice bike . Ce pot face ?

mergi la OnPlayerEnterVehicle si pune asa

 

if(IsAMotorBike(vehicleid)) {
        SetPlayerChatBubble(playerid, "[Aceast bike poate merge doar cu spatele!]", COLOR_RED, 2000);
     }

  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.