Advertisement
MGT

ExileClient_system_snow_thread_update.sqf

MGT
Jan 1st, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. private["_enableSnow","_surfaceTypes","_startPosition","_endPosition","_intersections","_isBelowRoof"];
  2. _enableSnow = false;
  3. _heightASL = getPosASL player select 2;
  4. _startPosition = getPosASL player;
  5. _endPosition = [_startPosition select 0, _startPosition select 1, (_startPosition select 2 ) + 15];
  6. _intersections = lineIntersectsSurfaces [_startPosition, _endPosition, player, objNull, false, 1, "GEOM", "VIEW"];
  7. _isBelowRoof = !(_intersections isEqualTo []);
  8. if (rain < 0.01) then
  9. {
  10. _surfaceTypes = getArray (missionConfigFile >> "CfgExileEnvironment" >> worldName >> "Snow" >> "surfaces");
  11. if ((surfaceType (getPos player) in _surfaceTypes) && (_heightASL >= 100) && !_isBelowRoof) then
  12. {
  13. _enableSnow = true;
  14. ExileSnowClose attachTo [vehicle player, [0, 4, 1]];
  15. ExileSnowNear attachTo [vehicle player, [0, 4, 1.5]];
  16. ExileSnowFar attachTo [vehicle player, [0, 4, 2]];
  17. };
  18. };
  19. if (_enableSnow) then
  20. {
  21. ExileSnowClose attachTo [vehicle player, [0, 4, 1]];
  22. ExileSnowNear attachTo [vehicle player, [0, 4, 1.5]];
  23. ExileSnowFar attachTo [vehicle player, [0, 4, 2]];
  24. ExileSnowClose setDropInterval 0.01;
  25. ExileSnowNear setDropInterval 0.01;
  26. ExileSnowFar setDropInterval 0.01;
  27. }
  28. else
  29. {
  30. ExileSnowClose setDropInterval 0;
  31. ExileSnowNear setDropInterval 0;
  32. ExileSnowFar setDropInterval 0;
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement