Epoch/Sources/epoch_code/compile/environment/EPOCH_client_earthQuake.sqf
2016-06-13 11:54:19 -05:00

40 lines
899 B
Plaintext

/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Triggers earthquake with increasing intensity the closer the player
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/environment/EPOCH_client_earthQuake.sqf
Example:
[_location] call EPOCH_client_earthQuake
Parameter(s):
_this: ARRAY - Locaton of epicenter
Returns:
Script handle
*/
private ["_intensity","_distance"];
params [["_epicenter",[0,0,0], [[]]]];
_distance = player distance _epicenter;
_intensity = 1;
if (_distance < 250) then {
_intensity = 4;
} else {
if (_distance < 500) then {
_intensity = 3;
} else {
if (_distance < 750) then {
_intensity = 2;
};
};
};
_intensity spawn BIS_fnc_earthQuake;