fn_getMobileRespawns

This commit is contained in:
Wyqer 2019-12-05 22:37:32 +01:00
parent fec002f37b
commit b70e3505d5
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
1 changed files with 13 additions and 13 deletions

View File

@ -2,26 +2,26 @@
File: fn_getMobileRespawns.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-11-25
Last Update: 2019-11-25
Last Update: 2019-12-05
License: MIT License - http://www.opensource.org/licenses/MIT
Description:
No description added yet.
Gets all mobile respawn vehicles sorted by their positions X value.
Parameter(s):
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
NONE
Returns:
Function reached the end [BOOL]
Mobile respawns [ARRAY]
*/
// TODO
private _respawn_trucks_unsorted = vehicles select {
(typeof _x == Respawn_truck_typename || typeof _x == huron_typename ) &&
_x distance2d startbase > 500 &&
!surfaceIsWater (getpos _x) &&
(isTouchingGround _x || {5 > ((getPos _x) select 2)}) &&
alive _x &&
speed _x < 5
private _respawn_trucks = vehicles select {
(typeOf _x) in [Respawn_truck_typename, huron_typename] &&
{alive _x} &&
{_x distance2d startbase > 500} &&
{abs (speed _x) < 5} &&
{(isTouchingGround _x || {5 > ((getPos _x) select 2)})} &&
{!surfaceIsWater (getPos _x)}
};
[_respawn_trucks_unsorted, [], {(getpos _x) select 0}, 'ASCEND'] call BIS_fnc_sortBy
[_respawn_trucks, [], {(getPos _x) select 0}, 'ASCEND'] call BIS_fnc_sortBy