Jump to content
Sign in to follow this  
Twiznak

[How To] Functional HEMTT Mover and SAM Trailers

Recommended Posts

Hello everyone! I read a post by another user and felt the need to finally give back to the community. I give to you functional HEMTT Movers and SAM trailers. these 3 addActions allow players to tow and un-tow SAM trailers. Works on dedicated servers too! Semper Prorsum!

 

 Steam Workshop Demo Mission

 

initPlayerLocal.sqf

Spoiler

Player addAction ["<t color='#FF0000'>TOW SAM Radar</t><img size='2' image='\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\use_ca'/>", 
"
	_target = (_this select 0);
	_pVeh = vehicle _target;
	_Rtrailer = nearestObject [_pVeh, 'B_Radar_System_01_F'];
	[_pVeh,_Rtrailer] spawn {
	_Veh = (_this select 0);
	_radar = (_this select 1);
	_radar allowDamage false; 
	[_radar,[_Veh,[0.03,-6.9,1.01]]] remoteExec ['attachTo',0];
	_radar setDir 0;
	_radar setPosASL getPosASL _radar;
	_radar enableSimulationGlobal true;
	} remoteExec ['spawn',0];
",
[],1,false,true,"",
" 
	_list = nearestObjects [_target,[], 15]; _hitched = attachedObjects vehicle _target; 
	(typeOf vehicle player == 'B_Truck_01_mover_F') && ( {typeof _x isEqualTo 'B_Radar_System_01_F'} count _list >= 1) && ( count _hitched == 0)
"
];

Player addAction ["<t color='#0000FF'>TOW SAM Launcher</t><img size='2' image='\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\use_ca'/>", 
"
	_target = (_this select 0);
	_pVeh = vehicle _target;
	_Ltrailer = nearestObject [_pVeh, 'B_SAM_System_03_F'];
	[_pVeh,_Ltrailer] spawn {
	_Veh = (_this select 0);
	_launcher = (_this select 1);
	_launcher allowDamage false; 
	[_launcher,[_Veh,[0.03,-7.3,1.95]]] remoteExec ['attachTo',0];
	_launcher setDir 0;
	_launcher setPosASL getPosASL _launcher;
	_launcher enableSimulationGlobal true;
	} remoteExec ['spawn',0];
",
[],1,false,true,"",
" 
	_list = nearestObjects [_target,[], 15]; _hitched = attachedObjects vehicle _target; 
	(typeOf vehicle player == 'B_Truck_01_mover_F') && ( {typeof _x isEqualTo 'B_SAM_System_03_F'} count _list >= 1) && ( count _hitched == 0)
"
];

Player addAction ["<t color='#00FF00'>Detatch Trailer</t><img size='2' image='\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\use_ca'/>", 
"
	_target = (_this select 0);
	_pVeh = vehicle _target;
	_pVeh spawn { {detach _x; _x setPos getPos _x; _x allowDamage true; _x enableSimulationGlobal true; } forEach attachedObjects _this; } remoteExec ['spawn',0];
",
[],1,false,true,"",
" 
	_hitched = attachedObjects vehicle _target;
	(typeOf vehicle player == 'B_Truck_01_mover_F') && ( count _hitched == 1)
"
];

 

Thank you Larrowpierremgi, and Davidoss . For me to be able to read someone's request for help and know what needs to be done before I even open notePad. Is all thanks to your tutelage. Both directly and indirectly through your extensive posts helping others.  I am in your debt, thank you.

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×