[FilterScript] Vehicle Killer (Unoccupied vehicle damage)
#1

Hi all,
Today I saw the new natives for pawn. I played a bit with OnUnoccupiedVehicleUpdate, and I did this.

It could be useful for someone, or not - decide it yourself. You can edit the defines to change the damage caused by weapons.

Okay, but.. erm... what the hell is it?
It let's you kill a car which doesn't come with a driver.

What weapons can I use to kill a car?
Pistols, machine guns, RPGs, Shotguns, and Minigun.

I am strong. Can I box down the car?
Yes, you can, but just if you are very strong.

Is this only for cars?
No. It's for all vehicles.

Okay, but.. erm... how can I use it?
You edit the defines for your needs, compile the script, then load as a filterscript. That's all.
Editing the damage values is more than suggested, because they might not be correct for your needs.

Okay, but.. erm... why they aren't correct?
Because I was too lazy to determine the best values.

F*** you! I don't want to use it! It's totally useless!
Why are you still here?

pwn Code:
pawn Код:
#define FILTERSCRIPT
#include <a_samp>

#define VEHICLE_DMG_DEFAULT 25.0

#define VEHICLE_DMG_COLT45 50.0
#define VEHICLE_DMG_SILENCED 50.0
#define VEHICLE_DMG_DEAGLE 75.0
#define VEHICLE_DMG_SHOTGUN 75.0
#define VEHICLE_DMG_SAWEDOFF 78.0
#define VEHICLE_DMG_SHOTGSPA 80.0
#define VEHICLE_DMG_UZI 35.0
#define VEHICLE_DMG_MP5 60.0
#define VEHICLE_DMG_AK47 80.0
#define VEHICLE_DMG_M4 80.0
#define VEHICLE_DMG_TEC9 40.0
#define VEHICLE_DMG_RIFLE 75.0
#define VEHICLE_DMG_ROCKETLAUNCHER 150.0
#define VEHICLE_DMG_HEATSEEKER 150.0
#define VEHICLE_DMG_MINIGUN 200.0

#define DecreaseVehHP(%1) if (vhp > %1) SetVehicleHealth(vehicleid, vhp - %1)

public OnFilterScriptInit()
{
    print("\n- Vehicle Killer Filterscript loaded -");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n- Vehicle Killer Filterscript unloaded -");
    return 1;
}

public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
{
    if (passenger_seat != 0) return;
    new cm = GetPlayerCameraMode(playerid);
    if (cm != 53 && cm != 51) return;
    new keys, tmp;
    GetPlayerKeys(playerid, keys, tmp, tmp);
    if (!(keys & KEY_FIRE)) return;
    new Float:vhp; GetVehicleHealth(vehicleid, vhp);
    switch (GetPlayerWeapon(playerid))
    {
        case WEAPON_COLT45: DecreaseVehHP(VEHICLE_DMG_COLT45);
        case WEAPON_SILENCED: DecreaseVehHP(VEHICLE_DMG_SILENCED);
        case WEAPON_DEAGLE: DecreaseVehHP(VEHICLE_DMG_DEAGLE);
        case WEAPON_SHOTGUN: DecreaseVehHP(VEHICLE_DMG_SHOTGUN);
        case WEAPON_SAWEDOFF: DecreaseVehHP(VEHICLE_DMG_SAWEDOFF);
        case WEAPON_SHOTGSPA: DecreaseVehHP(VEHICLE_DMG_SHOTGSPA);
        case WEAPON_UZI: DecreaseVehHP(VEHICLE_DMG_UZI);
        case WEAPON_MP5: DecreaseVehHP(VEHICLE_DMG_MP5);
        case WEAPON_AK47: DecreaseVehHP(VEHICLE_DMG_AK47);
        case WEAPON_M4: DecreaseVehHP(VEHICLE_DMG_M4);
        case WEAPON_TEC9: DecreaseVehHP(VEHICLE_DMG_TEC9);
        case WEAPON_RIFLE: DecreaseVehHP(VEHICLE_DMG_RIFLE);
        case WEAPON_ROCKETLAUNCHER: DecreaseVehHP(VEHICLE_DMG_ROCKETLAUNCHER);
        case WEAPON_HEATSEEKER: DecreaseVehHP(VEHICLE_DMG_HEATSEEKER);
        case WEAPON_MINIGUN: DecreaseVehHP(VEHICLE_DMG_MINIGUN);
        default: DecreaseVehHP(VEHICLE_DMG_DEFAULT);
    }
}
Credits:
I don't take any credits for it. Use, edit, sell if you want.

Known bugs:
Not yet.

Updates:
If I find a bug, or somebody sends me a good define set with usable damages, I will update.

Videos:
[ame]http://www.youtube.com/watch?v=VibVaD9otCQ[/ame]
[ame]http://www.youtube.com/watch?v=2sEn868Akco[/ame]
Reply
#2

COOL! Very COOL! But i need video or pics
Reply
#3

Okay. I make a video, just for you.
Reply
#4

Nice man!
It's cool
Reply
#5

video added.
Reply
#6

Heh, there are better scripts for this released.
Imagine, you are aiming in the opposite direction of the car, and you push the car walking backwards. The car will still take damage.
Reply
#7

I could not find any scripts released related to this.
And if you just aim, the car won't take damage. Just if you shoot.
Edit: new video added
Reply
#8

There are still two scripts like this. I think 2 are enough :P

OnEmptyVehicleDamage
and
Ares Vehicle Destruction
Reply
#9

Quote:
Originally Posted by KoczkaHUN
Посмотреть сообщение
I could not find any scripts released related to this.
And if you just aim, the car won't take damage. Just if you shoot.
Edit: new video added
Take an M4, start aiming with it, and bump into the car (walk towards it constantly while aiming), and start shooting. Voila! The car is taking damage. Use GetPlayerCameraPos and GetPlayerCameraFrontVector to make sure that the player is aiming at the car.
Reply
#10

Quote:
Originally Posted by KoczkaHUN
Посмотреть сообщение
I could not find any scripts released related to this.
And if you just aim, the car won't take damage. Just if you shoot.
Edit: new video added
What if you shoot while walking backwards? :P
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)