Skip to content

Commit

Permalink
Add Killed EH to vehicles (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinM9991 authored Jul 29, 2022
1 parent c80c9a7 commit ab49c37
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions addons/cars/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ private _vehicles = ["C_Van_01_Fuel_F"];
Parameter | Explanation
----------|-------------------------------------------------------------
vehicles | Array - All classnames of vehicles that civilians may drive.


### Events

#### grad_civs_cars_vehKilled

```sqf
["grad_civs_cars_vehKilled", { params ["_deathPos", "_killer", "_vehicle_"]; }] call CBA_fnc_addEventHandler;
```
9 changes: 9 additions & 0 deletions addons/cars/functions/fnc_spawnVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ _veh addEventHandler [
}
];

_veh addEventHandler [
"Killed",
{
params ["_unit", "_killer"];

["grad_civs_cars_vehKilled", [getPos _unit, _killer, _unit]] call CBA_fnc_globalEvent;
}
];

private _animalChance = GVAR(animalTransportChance);
[_veh, _animalChance] call FUNC(loadAnimals);

Expand Down

0 comments on commit ab49c37

Please sign in to comment.