SA-MP Forums Archive
Some help with vehicle things - 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: Some help with vehicle things (/showthread.php?tid=311749)



Some help with vehicle things - SomebodyAndMe - 18.01.2012

Someone suggested this on my server:
Quote:

There are multiple server with the feature that if your vehicle gets full damage (that it bursts into flames and will explode after some time) your engine will just stop and you have to wait for /assist or any kind of repair to drive again.
Black smoke will come out of your engine when its total loss.

But the problem is, I really don't know how to script that...

Could someone give me some information on what I can use the best?


Re: Some help with vehicle things - Joe_ - 18.01.2012

if the vehicles health reaches 250, set it to 300 and turn the engine off, that's what I do.

pawn Код:
new Float:Health, engine, lights, alarm, doors, bonnet, boot, objective;

for(new a = 0; a < MAX_VEHICLES; a++)
{
    GetVehicleHealth(a, Health);
   
    if(Health <= 250.0)
    {
        SetVehicleHealth(a, 300.0);
        GetVehicleParamsEx(a, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(a, 0, lights, alarm, doors, bonnet, boot, objective);
    }
}