How to stop vehicles from blowing up?
#1

Well today i need help on how to stop the vehicles form blowing up like i want to make it so when the vehicle health gets to 0.350 or something the engine will stop and it will say this vehicle engine is broken any idea or can you help me



engine command below
Код:
if(newstate == PLAYER_STATE_DRIVER)
	{
 		new vehicleid = GetPlayerVehicleID(playerid);
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
		{
        	SendClientMessage(playerid, COLOR_WHITE,"< To turn on the vehicle engine type {800040}/engine{FFFFFF} - to check radio commands type {800040}/radiohelp{FFFFFF} >");
		}
	}
Код:
if(strcmp(cmd, "/engine", true) == 0 || strcmp(cmd, "/engine", true) == 0)
	{
        new vid = GetPlayerVehicleID(playerid);
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(vid != INVALID_VEHICLE_ID)
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "You must be in a vehicle before you can do this!");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_GRAD2, "Only the driver can do this!");
		if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
		{
            SendClientMessage(playerid, -1, ""#COL_WHITE"> You have "#COL_GREEN" started"#COL_WHITE" the engine");
            GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s takes out the keys - inserts it into the ignition and twists it.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
        }
        else if(engine == VEHICLE_PARAMS_ON)
		{
            SendClientMessage(playerid, -1, ""#COL_WHITE"> You have "#COL_RED"stopped"#COL_WHITE" the engine");
            GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s extends his hand towards the ignition, twisting the keys.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
        }
		return 1;
    }
Reply


Messages In This Thread
How to stop vehicles from blowing up? - by Yves - 19.03.2013, 12:46
Respuesta: How to stop vehicles from blowing up? - by Xabi - 19.03.2013, 12:50
Re: How to stop vehicles from blowing up? - by Private200 - 19.03.2013, 12:51
Re: How to stop vehicles from blowing up? - by Konstantinos - 19.03.2013, 12:52
Re: How to stop vehicles from blowing up? - by Scenario - 19.03.2013, 12:57
Re: How to stop vehicles from blowing up? - by Yves - 19.03.2013, 13:04
Re: How to stop vehicles from blowing up? - by Scenario - 19.03.2013, 13:35
Re: How to stop vehicles from blowing up? - by Yves - 19.03.2013, 13:45
Re: How to stop vehicles from blowing up? - by Scenario - 19.03.2013, 14:00
Re: How to stop vehicles from blowing up? - by Yves - 19.03.2013, 14:09

Forum Jump:


Users browsing this thread: 1 Guest(s)