Destroy vehicle without a player in it
#1

It is possible to destroy a vehicle with a player driving it, but it's impossible to do so when nobody is in it.
How can I make it possible? Which file do I need to edit?

Thanks in advance!
Reply
#2

nothing is impossible if u're a good scripter, or have some abilites like Kar

well, there's a callback "publie OnPlayerWeaponShot" u can use it
Reply
#3

Quote:
Originally Posted by PMH
Посмотреть сообщение
nothing is impossible if u're a good scripter, or have some abilites like Kar

well, there's a callback "publie OnPlayerWeaponShot" u can use it
The problem is that I'm a noob, so I don't know which file to edit. I'm using 0.3z.
Reply
#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
#5

Quote:
Originally Posted by Stinged
Посмотреть сообщение
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;
}
Thanks!
Reply
#6

https://sampwiki.blast.hk/wiki/DestroyVehicle
Reply
#7

Quote:
Originally Posted by cessil
Посмотреть сообщение
Ummm.
I don't think he actually need this for his idea
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)