About vehicles health
#10

Quote:
Originally Posted by BP13
Посмотреть сообщение
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(GetVehicleModel(vehicleid)== 463)
    {
        SetVehicleHealth(vehicleid,10);
    }
    return 1;
}
Correct me if I'm wrong, but I believe SA:MP would reset the vehicles HP if someone else came across it while it was in use, yes?

The following is how I'd go about doing this task.
pawn Код:
public OnFilterScriptInit()
{
    new Spawn[] = {210, 232, 344, 318}; // Vehicle IDs to respawn
    for(new i; i < sizeof Spawn; i++)
    {
        SetVehicleToRespawn(Spawn[i]);
    }
    return 1;
}
public OnVehicleSpawn(vehicleid)
{
    if(vehicleid == 210) // 210 is the vehicles ID
    {
        SetVehicleHealth(210, 350); // Vehicles blow up around 250-270, so 350 is fairly low
        return 1;
    }
    return 1;
}
Not the greatest method, but it'll work.
Reply


Messages In This Thread
About vehicles health - by JulietaZ - 20.09.2010, 16:50
Re: About vehicles health - by Mauzen - 20.09.2010, 16:54
Re: About vehicles health - by Vince - 20.09.2010, 17:14
Re: About vehicles health - by Mauzen - 20.09.2010, 17:16
Re: About vehicles health - by JulietaZ - 21.09.2010, 01:13
Re: About vehicles health - by BP13 - 21.09.2010, 01:18
Re: About vehicles health - by JulietaZ - 21.09.2010, 03:11
Re: About vehicles health - by BP13 - 21.09.2010, 03:14
Re: About vehicles health - by JulietaZ - 21.09.2010, 04:18
Re: About vehicles health - by iFriSki - 21.09.2010, 20:46

Forum Jump:


Users browsing this thread: 1 Guest(s)