Arma 3 Code Dump: Difference between revisions

From Benargee's Wiki
Jump to navigation Jump to search
No edit summary
(Hint player camera direction)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{arma3}}
{{arma3}}
===Spawn in flying jet===
===Spawn in flying jet===
posi376 = [(getpos player) select 0, getpos player select 1, (getpos player select 2) + 400]; <br>
    posi376 = [(getpos player) select 0, getpos player select 1, (getpos player select 2) + 400]; <br>
vehicle648 = createVehicle ["B_Plane_CAS_01_F", posi376, [], 0, "FLY"]; <br>
    vehicle648 = createVehicle ["B_Plane_CAS_01_F", posi376, [], 0, "FLY"]; <br>
player moveInDriver vehicle648; <br>
    player moveInDriver vehicle648; <br>




===Get position of screen center===
===Get position of screen center===
''Similart to cursorTarget''<br>
''Similar to cursorTarget''<br>
screenToWorld [0.5, 0.5];
    screenToWorld [0.5, 0.5];
 
===Add all players to curator===
    _curator addCuratorEditableObjects [playableUnits, true]
 
===Add virtual arsenal to player or object===
    null = ["AmmoboxInit",[this,true,{true}]] spawn BIS_fnc_arsenal; <br>
See: [https://community.bistudio.com/wiki/BIS_fnc_arsenal BIS_fnc_arsenal BIKI]
 
===Fired bullet info===
    player addEventHandler ["fired", {hintSilent format ["0 = %1\n1 = %2\n2 = %3\n3 = %4\n4 = %5\n5 = %6\n",_this select 0,_this select 1,_this select 2,_this select 4,_this select 5,_this select 6]}]
===Hint player camera direction===
0 spawn {
While {true} do {
vec0 = positionCameraToWorld [0,0,0];     
vec1 = positionCameraToWorld [0,0,100];
diff = vec1 vectorDiff vec0;
dir = round ((diff select 0) atan2 (diff select 1));
if (dir <= 0) then {dir = dir + 360};
hintSilent str dir;
sleep 0.05
};
};

Latest revision as of 06:06, 7 April 2015

Spawn in flying jet

   posi376 = [(getpos player) select 0, getpos player select 1, (getpos player select 2) + 400]; 
vehicle648 = createVehicle ["B_Plane_CAS_01_F", posi376, [], 0, "FLY"];
player moveInDriver vehicle648;


Get position of screen center

Similar to cursorTarget

   screenToWorld [0.5, 0.5];

Add all players to curator

   _curator addCuratorEditableObjects [playableUnits, true]

Add virtual arsenal to player or object

   null = ["AmmoboxInit",[this,true,{true}]] spawn BIS_fnc_arsenal; 

See: BIS_fnc_arsenal BIKI

Fired bullet info

   player addEventHandler ["fired", {hintSilent format ["0 = %1\n1 = %2\n2 = %3\n3 = %4\n4 = %5\n5 = %6\n",_this select 0,_this select 1,_this select 2,_this select 4,_this select 5,_this select 6]}]

Hint player camera direction

0 spawn {
	While {true} do {
		vec0 = positionCameraToWorld [0,0,0];      
		vec1 = positionCameraToWorld [0,0,100]; 
		diff = vec1 vectorDiff vec0; 
		dir = round ((diff select 0) atan2 (diff select 1));
		if (dir <= 0) then {dir = dir + 360};
		hintSilent str dir;
		sleep 0.05
	};
};