Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. /**
  2. * ExileClient_object_player_event_onFired
  3. *
  4. * Exile Mod
  5. * www.exilemod.com
  6. * © 2015 Exile Mod Team
  7. *
  8. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10. */
  11.  
  12. private["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_object","_intersection","_firstInsection"];
  13. _unit = _this select 0;
  14. _weapon = _this select 1;
  15. _muzzle = _this select 2;
  16. _mode = _this select 3;
  17. _ammo = _this select 4;
  18. _magazine = _this select 5;
  19. _projectile = _this select 6;
  20. if (ExilePlayerInSafezone) then
  21. {
  22. if (local _projectile) then
  23. {
  24. deleteVehicle _projectile;
  25. };
  26. }
  27. else
  28. {
  29. switch (_weapon) do
  30. {
  31. case "Exile_Melee_Axe":
  32. {
  33. player playActionNow "GestureExileAxeSwing01";
  34. [] call ExileClient_object_tree_chop;
  35. };
  36. case "Exile_Melee_Shovel":
  37. {
  38. player playActionNow "GestureExileSledgeHammerSwing01";
  39. };
  40. case "Exile_Melee_SledgeHammer":
  41. {
  42. player playActionNow "GestureExileSledgeHammerSwing01";
  43. [] call ExileClient_object_shippingContainer_smash;
  44. };
  45. case "Put":
  46. {
  47. if (_magazine in ["DemoCharge_Remote_Mag", "SatchelCharge_Remote_Mag"]) then
  48. {
  49. _object = cursorTarget;
  50. if ((_object isKindOf "LandVehicle") || (_object isKindOf "Air") || (_object isKindOf "Boat") || (_object isKindOf "Man") || (_object isKindOf "Exile_Construction_Abstract_Static")) then
  51. {
  52. _intersection = lineIntersectsSurfaces
  53. [
  54. AGLToASL positionCameraToWorld [0, 0, 0],
  55. AGLToASL positionCameraToWorld [0, 0, 5],
  56. player,
  57. objNull,
  58. true,
  59. 1,
  60. "VIEW",
  61. "GEOM"
  62. ];
  63. if (count _intersection > 0) then
  64. {
  65. _firstInsection = _intersection select 0;
  66. if !(simulationEnabled _object) then
  67. {
  68. if (local _object) then
  69. {
  70. _object enableSimulation true;
  71. }
  72. else
  73. {
  74. ["enableSimulationRequest", [netId _object]] call ExileClient_system_network_send;
  75. };
  76. };
  77. _projectile setPosASL [0, 0, 0];
  78. _projectile attachTo [_object, _object worldToModel (ASLtoAGL (_firstInsection select 0)) ];
  79. _projectile setVectorUp (_firstInsection select 1);
  80. };
  81. };
  82. };
  83. };
  84. case "Throw":
  85. {
  86. switch (_magazine) do
  87. {
  88. case "Exile_Item_ZipTie":
  89. {
  90. player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
  91. call ExileClient_object_handcuffs_use;
  92. if (local _projectile) then
  93. {
  94. deleteVehicle _projectile;
  95. };
  96. };
  97. };
  98. };
  99. default
  100. {
  101. ExileClientPlayerIsInCombat = true;
  102. ExileClientPlayerLastCombatAt = diag_tickTime;
  103. true call ExileClient_gui_hud_toggleCombatIcon;
  104. if !(isNull _projectile) then
  105. {
  106. if (cameraView isEqualTo "GUNNER") then
  107. {
  108. if (isNumber (configFile >> "CfgMagazines" >> _magazine >> "exileBulletCam")) then
  109. {
  110. call ExileClient_system_bulletCam_destroy;
  111. ExileClientBulletCameraThread = _projectile spawn ExileClient_system_bulletCam_thread;
  112. };
  113. };
  114. };
  115. };
  116. };
  117. };
  118. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement