How to set health to all the sandkings?
#9

Hook the functions that create/add a vehicle. An example:
pawn Код:
stock HF_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
{
    if (modelid == 495) SetVehicleHealth(CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay), 150);
    else CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay);
    return 1;
}

#if defined _ALS_CreateVehicle
    #undef CreateVehicle
#else
    #define _ALS_CreateVehicle
#endif

#define CreateVehicle HF_CreateVehicle
Do the same for AddStaticVehicle and AddStaticVehicleEx too.

And when a vehicle respawns:
pawn Код:
public OnVehicleSpawn(vehicleid)
{
    if (GetVehicleModel(vehicleid) == 495) SetVehicleHealth(vehicleid, 150);
    return 1;
}
Reply


Messages In This Thread
How to set health to all the sandkings? - by Lirbo - 21.04.2014, 14:04
Re: How to set health to all the sandkings? - by Bingo - 21.04.2014, 14:10
Re: How to set health to all the sandkings? - by Lirbo - 21.04.2014, 14:18
Re: How to set health to all the sandkings? - by Bingo - 21.04.2014, 14:31
Re: How to set health to all the sandkings? - by RunAways - 21.04.2014, 14:36
Re: How to set health to all the sandkings? - by Abagail - 21.04.2014, 14:36
Re: How to set health to all the sandkings? - by Lirbo - 21.04.2014, 15:07
Re: How to set health to all the sandkings? - by iZN - 21.04.2014, 15:13
Re: How to set health to all the sandkings? - by Konstantinos - 21.04.2014, 15:29
Re: How to set health to all the sandkings? - by Lirbo - 21.04.2014, 15:44

Forum Jump:


Users browsing this thread: 2 Guest(s)