-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add decaying markers for vehicles after killer is teleported (#56)
* Add decaying markers for vehicles after killer is teleported * Add local version of marker decay * Fix radius parameter unused * Create markers only for empty vehicles * Fix markers still visible for everyone
- Loading branch information
Showing
6 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
addons/killers/functions/fnc_createMarkersForNearbyVehicles.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: 3Mydlo3 | ||
* Searches for vehicles in given radius near given position. | ||
* Creates a decaying marker for each vehicle. | ||
* | ||
* Arguments: | ||
* 0: Search position <POSITION> | ||
* 1: Search radius <NUMBER> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [getPos bob, 500] call afsk_killers_fnc_createMarkersForNearbyVehicles | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_position", ["_radius", 1000]]; | ||
|
||
private _nearbyVehicles = _position nearEntities [["Air", "Car", "Motorcycle", "Tank"], _radius]; | ||
private _emptyVehicles = _nearbyVehicles select { | ||
crew _x isEqualTo [] | ||
}; | ||
|
||
{ | ||
private _vehicle = _x; | ||
private _marker = createMarkerLocal [format ["vehicle_%1", _vehicle], getPos _vehicle]; | ||
_marker setMarkerColorLocal "ColorCIVILIAN"; | ||
_marker setMarkerTextLocal getText (configFile >> "CfgVehicles" >> (typeof _vehicle) >> "displayName"); | ||
|
||
private _markerType = if (_vehicle isKindOf "Air") then { | ||
if (_vehicle isKindOf "Plane") then { "loc_plane" } else { "loc_heli" } | ||
} else { "loc_car" }; | ||
_marker setMarkerTypeLocal _markerType; | ||
|
||
[_marker, 2, true] call EFUNC(markers,markerDecay); | ||
} forEach _emptyVehicles; | ||
|
||
nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters