Prevent a vehicle from exploding?
#7

Quote:
Originally Posted by Mike Garber
View Post
I've made It before,
1. Check (all) vehicle(s) health in a loop
2. If vehicles health is below 500, freeze player, remove from vehicle, unfreeze player
3. Put this in a 2 seconds or so timer
4. Done.

Aslong as there's someone in the vehicle the vehicle will take damage. And being on the edge like you were by
activating it first at 300 makes It very easy to go below that, which causes it to catch fire.

Once It catches fire there's no going back, It will explode.
It catches fire at EXACTLY 250 and as Mike Garber said, when it catches fire there is no going back.
And why not use OnPlayerUpdate with a check to see if a player is in any vehicle like.

pawn Code:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new Float:health, veh;
        veh = GetPlayerVehicleID(playerid);
        GetVehicleHealth(veh, health);
        if(health <400)
        {
                RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Now you can for example, make the vehicle go 'locked' that way you'll have to get a mechanic to come to the car to repair it.

(basicly told the idea I had for my own script lol)
Reply


Messages In This Thread
Prevent a vehicle from exploding? - by Kyle_Olsen - 11.11.2010, 12:10
Re: Prevent a vehicle from exploding? - by Celson - 11.11.2010, 12:14
Re: Prevent a vehicle from exploding? - by Kyle_Olsen - 11.11.2010, 12:18
Re: Prevent a vehicle from exploding? - by Flyfishes - 11.11.2010, 12:31
Re: Prevent a vehicle from exploding? - by Kyle_Olsen - 11.11.2010, 12:49
Re: Prevent a vehicle from exploding? - by Mike Garber - 11.11.2010, 13:31
Re: Prevent a vehicle from exploding? - by playbox12 - 11.11.2010, 14:38
Re: Prevent a vehicle from exploding? - by The_Moddler - 11.11.2010, 14:45
Re: Prevent a vehicle from exploding? - by playbox12 - 11.11.2010, 14:59
Re: Prevent a vehicle from exploding? - by The_Moddler - 11.11.2010, 15:15

Forum Jump:


Users browsing this thread: 1 Guest(s)