Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- LRF script
- a: reyhard
- */
- _k=format["RHS_%1_ctrl",_this select 2];
- if(isNull (uiNamespace getVariable [_k,displayNull]))then
- {
- uiNameSpace setVariable [_k,_this select 0];
- [_this select 1,_k] spawn
- {
- waitUntil {isNil "rhs_acog_cam"};
- private["_v","_t"];
- disableSerialization;
- _c = uiNamespace getVariable (_this select 1);
- _z = (_c displayCtrl 168);
- _id = addMissionEventHandler ["Draw3D",
- {
- //attach to cause to double camera rotation
- _p=(call rhsusf_fnc_findPlayer);
- //should be right hand as it glued to weapon most of the time
- if (rhs_acog_cam != nil) {
- rhs_acog_cam setPosATL (_p modelToWorld ((player selectionPosition "leftHand") vectorAdd [-0.03,0.14,0.1]));
- _w = _p weaponDirection (primaryWeapon _p);
- _r = vectorNormalized(_w vectorCrossProduct [0,0,1]);
- _u = _r vectorCrossProduct _w;
- rhs_acog_cam setVectorDirAndUp [_w ,_u];
- };
- }];
- _k=true;
- while{not(isnull _z)}do
- {
- sleep 0.1;
- if(cameraView == "gunner")then{
- if(_k)then{
- if (rhs_acog_cam == nil) {
- rhs_acog_cam = "camera" camCreate [0,0,0];
- rhs_acog_cam cameraEffect ["internal", "Back", "furlong_pip"];
- rhs_acog_cam camSetFov 0.35/(_this select 0);
- };
- rhs_acog_cam cameraEffect ["internal", "Back", "furlong_pip"];
- _k=false;
- };
- }else{
- if (rhs_acog_cam != nil) {
- rhs_acog_cam cameraeffect ["terminate","back"];
- camDestroy rhs_acog_cam;
- rhs_acog_cam =nil;
- };
- _k=true;
- };
- };
- uiNameSpace setVariable [(_this select 1),displayNull];
- removeMissionEventHandler ["draw3d",_id];
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement