SA-MP Forums Archive
Stopcars blowing up - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Stopcars blowing up (/showthread.php?tid=304983)



Stopcars blowing up - [LHT]Bally - 20.12.2011

how do i stop the cars setting on fire and blowing up ? instead i would like it to say your vehicle has roken down use /assistance to repair the vehicle


Re: Stopcars blowing up - AstonDA-G - 20.12.2011

You should check if the vehicle's health is less than so much. If it is, switch the vehicle's engine off, and then switch it back on after you type /assistance or whenever


Re: Stopcars blowing up - -Rebel Son- - 20.12.2011

pawn Код:
new Float:vHealth;
GetVehicleHealth(vehicleid, vHealth);

if(vHealth < 450)
{
//engine code here
SendClientMessage(playerid, color, "You car has broken down!");
}
Untested.


Re: Stopcars blowing up - [LHT]Bally - 20.12.2011

i got some code other day by someone and when the vehicle was repaired the engine wasnt switched on


Re: Stopcars blowing up - AstonDA-G - 20.12.2011

when the vehicle is repaired, put this:
pawn Код:
new vengine,vlights,valarm,vdoors,vbonnet,vboot,vobjective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid),vengine,vlights,valarm,vdoors,vbonnet,vboot,vobjective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,vlights,valarm,vdoors,vbonnet,vboot,vobjective);
That will switch the engine back on


Re: Stopcars blowing up - -Rebel Son- - 20.12.2011

If you combine AstonDA's code with my mockup, that should do ya.


Re: Stopcars blowing up - [LHT]Bally - 20.12.2011

anyone have teamviewer to help out ?


Re: Stopcars blowing up - AstonDA-G - 20.12.2011

Yay, Teamwork :3
Put my code where Rebel wrote '//engine code here' ;d


Re: Stopcars blowing up - [LHT]Bally - 20.12.2011

but i have a repairall command so how would all this work using my command ? and i have a mechanic class that works off keys like lctrl


Re: Stopcars blowing up - [LHT]Bally - 20.03.2012

i have tried all this with no joy need some help