PDA

View Full Version : Some help with vehicle things


SomebodyAndMe
18/01/2012, 08:22 AM
Someone suggested this on my server:
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?

Joe_
18/01/2012, 11:06 AM
if the vehicles health reaches 250, set it to 300 and turn the engine off, that's what I do.


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);
}
}