Vehicle health
#10

Quote:
Originally Posted by arakuta
Посмотреть сообщение
I was about to say the same.

If a COP vehicle gets seriously damaged, then another COP vehicle spawn, all cop vehicles will magically repair.

So, the correct is when the vehicle spawns, set just its health

pawn Код:
public OnVehicleSpawn(vehicleid)
{
        if(GetVehicleModel(vehicleid[i]) == 470)
        {
            SetVehicleHealth(vehicleid[i], 2500);
        }
    return 1;
}
But OnVehicleSpawn will only get called when a vehicle RE-SPAWNS (Not when the vehicle gets created)

Now the loop will make sense...

pawn Код:
// AddStaticVehicle...
// AddStaticVehicle...
// AddStaticVehicle...

for(new i; i < MAX_VEHICLES; i ++) // creating a loop through all vehicles
{
    if(GetVehicleModel(vehicleid[i]) == 470)
    {
        SetVehicleHealth(vehicleid[i], 2500);
    }// for each LSPD vehicle set vehicle health to 2500 as you want!
}
I'm using this code for the factions vehicles
pawn Код:
for(new i; i < MAX_VEHICLES; i ++) // creating a loop through all vehicles
    {
        if(vehicleid == LSPDVehicles[i])
        {
        SetVehicleHealth(vehicleid,2500);
        }// for each LSPD vehicle set vehicle health to 2500 as you want!
    }
    for(new i; i < MAX_VEHICLES; i ++) // creating a loop through all vehicles
    {
        if(vehicleid == FBIVehicles[i])
        {
        SetVehicleHealth(vehicleid,2500);
        }// for each LSPD vehicle set vehicle health to 2500 as you want!
    }
But the one with LSPDVehicles works but the FBIVehicles doennt work maybe do you know why?
Reply


Messages In This Thread
Vehicle health - by Dorlevi1506 - 12.12.2013, 16:34
Re: Vehicle health - by dominik523 - 12.12.2013, 17:06
Re: Vehicle health - by xVIP3Rx - 12.12.2013, 17:19
Re: Vehicle health - by Dorlevi1506 - 12.12.2013, 17:41
Re: Vehicle health - by SilentSoul - 12.12.2013, 17:49
Re: Vehicle health - by Dorlevi1506 - 12.12.2013, 18:43
Re: Vehicle health - by Loot - 12.12.2013, 18:52
Re: Vehicle health - by Pottus - 12.12.2013, 18:56
Re: Vehicle health - by arakuta - 12.12.2013, 19:34
Re: Vehicle health - by Dorlevi1506 - 12.12.2013, 19:50

Forum Jump:


Users browsing this thread: 1 Guest(s)