20.02.2018, 07:38
Does anyone know how I can this adding Hp in vehicles, all cars tested are indestructible

SetVehicleHealth(vehicleid, Float:health);
if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
if(GetVehicleID(hitid) != INVALID_VEHICLE_ID)
{
new Float:VHP;
GetVehicleHealth(hitid,VHP);
SetVehicleHealth(hitid,VHP-30); // you can set damage for each weapons
}
}
you can make an unoccupied vehicle damageable with OnPlayerWeaponShot callback.
PHP код:
|
hitid != INVALID_VEHICLE_ID