Destroy vehicle without a player in it
#4

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;
}
Reply


Messages In This Thread
Destroy vehicle without a player in it - by Eatos - 01.09.2014, 19:07
Re: Destroy vehicle without a player in it - by PMH - 01.09.2014, 19:12
Re: Destroy vehicle without a player in it - by Eatos - 01.09.2014, 19:14
Re: Destroy vehicle without a player in it - by Stinged - 01.09.2014, 19:47
Re: Destroy vehicle without a player in it - by Eatos - 01.09.2014, 23:26
Re: Destroy vehicle without a player in it - by cessil - 02.09.2014, 01:36
Re: Destroy vehicle without a player in it - by amirab - 02.09.2014, 02:32

Forum Jump:


Users browsing this thread: 1 Guest(s)