18.06.2013, 02:50
Personally, i'd use the method above by Alternative112
Then use in place of the "anything else", SetVehicleParams. Kind of like this:
So if the car gets damaged too much it'll disable everything, or set it to "off". EG: alarm off, doors closed, bonnet closed etc. Then when you type /engine to turn it back on, it'll check if its disabled. If it isnt, it'll start the engine 
You may want to add this though for it to work:
pawn Код:
new bool:disabled[MAX_VEHICLES];
public OnVehicleDamageStatusUpdate(vehicleid, playerid) {
//Will ONLY trigger when the car takes physical damage (no bullets)
new Float:vHealth;
GetVehicleHealth(vehicleid, vHealth);
if (health =< 300.0) {
disabled[vehicleid] = true;
}
return 1;
}
CMD:engine(playerid, params) {
//Do your validation stuff here
if (disabled[GetPlayerVehicleID(playerid)]) {
SendClientMessage(playerid, 0xCC0000FF, "The car's engine is too damaged to start!");
//Anything else you want to do
}
else {
//What to do when car is healthy
}
return 1;
}
pawn Код:
new bool:disabled[MAX_VEHICLES];
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
new Float:vHealth;
GetVehicleHealth(vehicleid, vHealth);
if (health =< 300.0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,objective);
disabled[vehicleid] = true;
}
return 1;
}
CMD:engine(playerid, params)
{
if (disabled[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, 0xCC0000FF, "The car's engine is too damaged to start!");
else
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid,1, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}

You may want to add this though for it to work:
pawn Код:
public OnGameModeInit()
{
ManualVehicleEngineAndLights();
return 1;
}