SetVehicleHealth help !!
#3

Remember that OnVehicleSpawn is called when a vehicle respawns not when it is created. You can hook CreateVehicle and the other 2 functions that add static vehicles though. An example:
pawn Код:
stock HF_CreateVehicle(modelid, Float: x, Float: y, Float: z, Float: angle, color1, color2, respawn_delay, addsiren = 0)
{
    new
        vehicleid = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay, addsiren);
       
    switch (modelid)
    {
        // SANG aircrafts
        case 425, 520: SetVehicleHealth(vehicleid, 2500);
        // FBI armored truck
        case 427, 528: SetVehicleHealth(vehicleid, 5000);
        // NG tank
        case 432: SetVehicleHealth(vehicleid, 10000);
    }
    return vehicleid;
}

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

#define CreateVehicle HF_CreateVehicle
Reply


Messages In This Thread
SetVehicleHealth help !! - by D3vin - 13.05.2016, 13:24
Re: SetVehicleHealth help !! - by Nin9r - 13.05.2016, 13:30
Re: SetVehicleHealth help !! - by Konstantinos - 13.05.2016, 13:31
Re: SetVehicleHealth help !! - by F1N4L - 13.05.2016, 13:32
Re: SetVehicleHealth help !! - by D3vin - 13.05.2016, 13:43
Re: SetVehicleHealth help !! - by D3vin - 13.05.2016, 15:33
Re: SetVehicleHealth help !! - by D3vin - 13.05.2016, 15:49
Re: SetVehicleHealth help !! - by Dayrion - 13.05.2016, 16:56
Re: SetVehicleHealth help !! - by Sjn - 13.05.2016, 17:01
Re: SetVehicleHealth help !! - by Dayrion - 13.05.2016, 17:26

Forum Jump:


Users browsing this thread: 1 Guest(s)