mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
Update + PBO
This commit is contained in:
parent
160dc773ed
commit
600f3445e4
@ -37,6 +37,7 @@ class CfgFunctions
|
||||
class FillCrate {};
|
||||
class FindSafePos {};
|
||||
class FindSuppressor {};
|
||||
class IsPlayerNearby {};
|
||||
class IsNearWater {};
|
||||
class MissionsMonitor {};
|
||||
class MissionSuccessState {};
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
// If you're gonna make any changes to DMS functions and/or create any new missions, it's a good idea to enable this :)
|
||||
DMS_DEBUG = false;
|
||||
DMS_DEBUG = true;
|
||||
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ _clean =
|
||||
{
|
||||
if (isNull _x) exitWith {};
|
||||
|
||||
if !([_x,DMS_CleanUp_PlayerNearLimit] call ExileServer_util_position_isPlayerNearby) then
|
||||
if !([_x,DMS_CleanUp_PlayerNearLimit] call DMS_fnc_IsPlayerNearby) then
|
||||
{
|
||||
_x call _clean;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ if(DMS_SpawnBoxSmoke && {sunOrMoon == 1}) then {
|
||||
};
|
||||
|
||||
if (DMS_SpawnBoxIRGrenade && {sunOrMoon != 1}) then {
|
||||
_marker = "B_IR_Grenade" createVehicle getPosATL _crate;
|
||||
_marker = "B_IRStrobe" createVehicle getPosATL _crate;
|
||||
_marker setPosATL (getPosATL _crate);
|
||||
_marker attachTo [_crate, [0,0,0]];
|
||||
_marker attachTo [_crate, [0,0,0.5]];
|
||||
};
|
@ -38,7 +38,7 @@ while{!_validspot} do {
|
||||
};
|
||||
|
||||
// Check for nearby players
|
||||
if ([_pos,DMS_PlayerNearBlacklist] call ExileServer_util_position_isPlayerNearby) exitWith
|
||||
if ([_pos,DMS_PlayerNearBlacklist] call DMS_fnc_IsPlayerNearby) exitWith
|
||||
{
|
||||
throw ("players");
|
||||
};
|
||||
|
50
@ExileServer/addons/a3_dms/scripts/fn_IsPlayerNearby.sqf
Normal file
50
@ExileServer/addons/a3_dms/scripts/fn_IsPlayerNearby.sqf
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
DMS_fnc_IsPlayerNearby
|
||||
Created by eraser1
|
||||
|
||||
Usage:
|
||||
[
|
||||
_positionOrObject,
|
||||
_distance
|
||||
] call DMS_fnc_IsPlayerNearby;
|
||||
|
||||
Returns whether or not a player is within "_distance" meters of "_positionOrObject".
|
||||
*/
|
||||
|
||||
private ["_pos", "_dis", "_isNear"];
|
||||
|
||||
_OK = params
|
||||
[
|
||||
["_pos", "", [objNull,[]], [2,3]],
|
||||
["_dis", 0, [0]]
|
||||
];
|
||||
|
||||
if (!_OK) exitWith
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling DMS_fnc_IsPlayerNearby with invalid parameters: %1",_this];
|
||||
};
|
||||
|
||||
_isNear = false;
|
||||
|
||||
try
|
||||
{
|
||||
{
|
||||
{
|
||||
if (isPlayer _x) then
|
||||
{
|
||||
throw _x;
|
||||
};
|
||||
} forEach (crew _x);
|
||||
} forEach (_pos nearEntities [["Exile_Unit_Player","LandVehicle", "Air", "Ship"], _dis]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_isNear = true;
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
diag_log format ["DMS_DEBUG IsPlayerNearby :: %1 is within %2 meters of %3!",_exception,_dis,_pos];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
_isNear;
|
@ -55,7 +55,7 @@ _success = true;
|
||||
};
|
||||
case "playerNear":
|
||||
{
|
||||
_success = _completionArgs call ExileServer_util_position_isPlayerNearby;
|
||||
_success = _completionArgs call DMS_fnc_IsPlayerNearby;
|
||||
};
|
||||
};
|
||||
} forEach _this;
|
||||
|
@ -73,7 +73,7 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
throw format ["Mission Success at %1 with message %2.",_pos,_msgWIN];
|
||||
};
|
||||
|
||||
if (DMS_MissionTimeoutReset && {[_pos,DMS_MissionTimeoutResetRange] call ExileServer_util_position_isPlayerNearby}) then
|
||||
if (DMS_MissionTimeoutReset && {[_pos,DMS_MissionTimeoutResetRange] call DMS_fnc_IsPlayerNearby}) then
|
||||
{
|
||||
_x set [2,[diag_tickTime,_timeUntilFail]];
|
||||
|
||||
|
Binary file not shown.
@ -74,6 +74,10 @@ if (!hasInterface && !isServer) then
|
||||
|
||||
|
||||
## Changelog:
|
||||
#### September 5, 2015 (12:00 AM CST-America):
|
||||
* Created new function "DMS_fnc_IsPlayerNearby" to replace "ExileServer_util_position_isPlayerNearby".
|
||||
* Fix IR Strobes spawning inside the crate and not appearing.
|
||||
|
||||
#### September 4, 2015 (11:20 PM CST-America):
|
||||
* Improved crate handling by DMS. You can now spawn multiple crates with different loot, or simply no crates at all. (REQUIRES FILE CHANGES FOR EACH MISSION)
|
||||
* Accounted for case sensitivity in switch-do statements for SpawnAISolder.
|
||||
|
Loading…
Reference in New Issue
Block a user