droideka_driver.sqf 910 B

12345678910111213141516171819202122232425262728293031323334
  1. // Created by Rexi to make things move
  2. #include "../../config_macros.hpp"
  3. params[
  4. ["_vic",objNull,[player]]
  5. ];
  6. if(isNull _vic) exitWith {
  7. };
  8. if (isServer) then {
  9. _group = createGroup east;
  10. _aidrive = _group createUnit ["O_Soldier_VR_F", position _vic, [], 0, "CAN_COLLIDE"];
  11. _vic attachTo [_aidrive,[0,-0.3,1]];
  12. _aidrive allowDamage false;
  13. _aidrive setUnitPos "down";
  14. _aidrive setBehaviour "CARELESS";
  15. [_aidrive, true] remoteExec ["hideObjectGlobal", 0];
  16. _curators = objectCurators _vic;
  17. { _x addCuratorEditableObjects [[_aidrive], true] } forEach _curators;
  18. _vic addEventHandler ["Killed", {
  19. params ["_unit", "_killer", "_instigator", "_useEffects"];
  20. [_unit] spawn macro_fnc_name(remove_attached_objects)
  21. }];
  22. _vic addMPEventHandler ["MPKilled", {
  23. params ["_unit", "_killer", "_instigator", "_useEffects"];
  24. [_unit] spawn macro_fnc_name(remove_attached_objects)
  25. }];
  26. };