01.09.2014, 19:47
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if (hittype == BULLET_HIT_TYPE_VEHICLE) // Checking if the player shot a vehicle
// Now hitid is the vehicleid
{
new Float:vhp;
GetVehicleHealth(hitid, vhp);
switch (weaponid)
{
case WEAPON_DEAGLE: SetVehicleHealth(hitid, vhp - 75);// Checking if the weapon is a desert eagle, then removing from the vehicle health 75 hp. You can modify it of course.
// Add your own, just giving and example.
}
return 0; // Preventing the default damage if someone was in a vehicle. All vehicle damage (Driver and no driver) is now like this.
}
return 1;
}