create_turrets.sqf 906 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "../../config_macros.hpp"
  2. params[
  3. ["_vic",objNull ,[player]],
  4. ["_new_turret",macro_quote(macro_new_vehicle(turret_ATTE,Rear_UAV)) ,['string']],
  5. ["_attach_pos",[0,0,0],[[1,2,3]],3],
  6. ["_direction_face",0,[180]]
  7. ];
  8. //if we cant use sleep ,spawn this cript
  9. if (!canSuspend) exitWith {
  10. _vic spawn macro_fnc_name(atte_uav_init);
  11. };
  12. //if not the server,exit
  13. if (!isServer) exitWith {};
  14. //check if still alive or if deleted
  15. if(isNull _vic || !(alive _vic)) exitWith {
  16. };
  17. if(_new_turret isEqualTo '') exitWith {
  18. };
  19. _atte_turret = _new_turret createVehicle (getPosASL _vic);
  20. _atte_turret attachTo [_vic,_attach_pos];
  21. createVehicleCrew _atte_turret;
  22. _atte_turret allowCrewInImmobile true;
  23. _atte_turret setdir _direction_face;
  24. //_atte_turret hideObjectGlobal true;
  25. _atte_turret disableAI "target";
  26. [_atte_turret, true] remoteExec ["hideObjectglobal", 0];