Hei Unnamed
Sorry man.
Yes i'am using exec and loadfile: Take a look
Here is the init.sqs i call it for sniperinit.sqs:
player addaction ["Bullet camera on","\Bab\script\bulletcam\sniperTrackEryx.sqs"]
player addEventHandler ["fired",{_Missile = nearestObject [vehicle(player), _this select 4];[_missile] exec "\Bab\script\bulletcam\sniperfired.sqs"}]
track = false
Here is the SnipertrackEryx.sqs file:
_ID = _this select 2
player removeAction _ID
? !(track) : track = true ; player addaction ["Bullet camera off", "\Bab\script\bulletcam\sniperTrackEryx.sqs"];exit
? (track) : track = false; player addaction ["Bullet camera on", "\Bab\script\bulletcam\sniperTrackEryx.sqs"]
Here is the sniperload.sqs file:
_this call loadFile "\BAB\script\bulletcam\PosBullCam.sqf"
Here is the sniperfired.sqs file:
_Missile = _this select 0
? isNull _Missile : exit
? !(track) : exit
_ok = createDialog "Speed"
? !(_ok) : exit
setAccTime 0.01
_Type= typeOf _Missile
_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
sliderSetRange [100, 0.01, 1]
sliderSetSpeed [100, 0.5, 2.0]
sliderSetPosition [100, 0]
sliderSetRange [99, 0.1, 1]
sliderSetPosition [99, 1]
sliderSetSpeed [99, 0.1, .25]
sliderSetRange [98, -180, 180]
sliderSetPosition [98, 0]
sliderSetSpeed [98, 0.5, 2.0]
sliderSetRange [97, -15000, 15000]
sliderSetPosition [97, 0]
sliderSetSpeed [97, 0.5, 2.0]
#loop
? _Type != typeOf _Missile : goto "end"
[ _Missile ,_cam,(sliderPosition 99),(sliderPosition 98),(sliderPosition 97)] call PosBullcam
setAccTime (sliderPosition 100)
? ctrlvisible 100 : goto "loop"
#End
? (getpos _cam select 1 == 0) or !(_Type != typeOf _Missile) : goto "SkipSlowEnd"
setAccTime 0.2
~0.85
#SkipSlowEnd
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
closedialog 0
setAccTime 1
exit
Here is the PosBullcam.sqf file:
private ["_Cam", "_Zoom", "_Missile", "_Rotate ","_zView"];
_Missile = _This select 0;
_Cam = _this select 1;
_Zoom = _This select 2;
_Rotate = _This select 3;
_zview = _This select 4;
_cam camsetpos getpos _missile;
_cam camSetFov _Zoom;
_cam camsettarget [((getpos _missile select 0) + ((sin (getdir _Missile + _Rotate ))* 5000 )), (getpos _missile select 1)+ (((cos (getdir _Missile +_Rotate ))* 5000 )) , ((getPos _Missile select 2)+(velocity _Missile select 2))+ _zview ];
_cam camcommit 0;
ctrlSettext [101,format["%1 meters",(_Missile distance player)]] ;
ctrlSettext [102,format["%1 m/s",( (Speed _missile )* 1000 ) / 3600 ]];
ctrlSettext [103,format["%1", velocity _Missile ]];
Here is the description.ext i call it for sniper.h:
#define CT_STATICÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 0
#define CT_BUTTONÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1
#define CT_EDITÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 2
#define CT_SLIDERÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 3
#define CT_COMBOÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 4
#define CT_LISTBOXÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 5
#define CT_TOOLBOXÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 6
#define CT_CHECKBOXESÂ Â Â Â Â Â Â Â Â Â Â Â 7
#define CT_PROGRESSÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 8
#define CT_HTMLÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 9
#define CT_STATIC_SKEWÂ Â Â Â Â Â Â Â Â 10
#define CT_ACTIVETEXTÂ Â Â Â Â Â Â Â Â Â Â Â 11
#define CT_TREEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 12
#define CT_3DSTATICÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 20
#define CT_3DACTIVETEXTÂ Â Â Â Â Â Â Â Â 21
#define CT_3DLISTBOXÂ Â Â Â Â Â Â Â Â Â Â Â 22
#define CT_3DHTMLÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 23
#define CT_3DSLIDERÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 24
#define CT_3DEDITÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 25
#define CT_OBJECTÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 80
#define CT_OBJECT_ZOOMÂ Â Â Â Â Â Â Â Â 81
#define CT_OBJECT_CONTAINERÂ Â Â 82
#define CT_OBJECT_CONT_ANIMÂ Â Â 83
#define CT_USERÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 99
#define ST_HPOSÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 0x0F
#define ST_LEFTÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 0
#define ST_RIGHTÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1
#define ST_CENTERÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 2
#define ST_UPÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 3
#define ST_DOWNÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 4
#define ST_VCENTERÂ Â Â Â Â Â Â Â Â Â Â Â 5
#define ST_TYPEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 0xF0
#define ST_SINGLEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 0
#define ST_MULTIÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 16
#define ST_TITLE_BARÂ Â Â Â Â Â Â Â Â 32
#define ST_PICTUREÂ Â Â Â Â Â Â Â Â Â Â Â 48
#define ST_FRAMEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 64
#define ST_BACKGROUNDÂ Â Â Â Â Â Â Â Â 80
#define ST_GROUP_BOXÂ Â Â Â Â Â Â Â Â 96
#define ST_GROUP_BOX2Â Â Â Â Â Â Â Â Â 112
#define ST_HUD_BACKGROUNDÂ Â Â 128
#define ST_TILE_PICTUREÂ Â Â Â Â Â 144
#define ST_WITH_RECTÂ Â Â Â Â Â Â Â Â 160
#define ST_LINEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 176
#define ST_SHADOWÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 256
#define ST_NO_RECTÂ Â Â Â Â Â Â Â Â Â Â Â 512
#define ST_TITLEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â ST_TITLE_BAR + ST_CENTER
#define IDC_OKÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1
#define IDC_CANCELÂ Â Â Â Â Â Â Â Â Â Â Â 2
#define TextColor         0.08, 0.08, 0.12
#define InvTextColor   0.35, 0.38, 0.36
#define FontS "tahomaB24"
#define FontM "tahomaB36"
#define FontHTML "courierNewB64"
#define FontHTMLBold "courierNewB64"
#define FontMAP "courierNewB64"
#define FontMAIN "SteelfishB64"
#define FontMAINCZ "SteelfishB64CE"
#define FontTITLE "SteelfishB128"
#define FontTITLEHalf "SteelfishB64"
#define FontBOOK "garamond64"
#define FontNOTES "AudreysHandI48"
class RscText   {type = 0;
      idc = -1;
      style = 0;
      h = .04;
      colorBackground[] = {0, 0, 0, 0};
      colorText[] = {.08, .08, .12, .75};
      font = FontS;
      size = .02;};
class RscEdit  Â
   {
         type = CT_EDIT;
         idc = -1;
         style = ST_LEFT;
         font = FontHTML;
         sizeEx = 0.02;
         colorText[] = {0, 0, 0, 1};
         colorSelection[] = {0.5, 0.5, 0.5, 1};
         autocomplete = true;text = ;
         };
class RscPicture  Â
   {
         type = CT_STATIC;
         idc = -1;
         style = ST_PICTURE;
         colorBackground[] = {0, 0, 0, 1};
         colorText[] = {1, 1, 1, 1};
         font = FontS;size = 0;
         };
class RscTextSmall  Â
   {
         type = CT_STATIC;
         idc = -1;
         style = ST_LEFT;
         h = 0.04;
         colorBackground[] = {0, 0, 0, 0};
         colorText[] = {.08, .08, .12, .75};
         font = FontS;
         size = 0.7;};
class RscBackground   {type = 0;
         idc = -1;
         style = 80;
         x=.15;
         y=.15;
         w=.7;
         h = 0.7;
         text = "";
         colorBackground[] = {1, 1, 1, 1};
         colorText[] = {0, 0, 0, 0};
         font = FontS;
         sizeEx = 0;
         };
class RscTitle   {  Â
         type = 0;
         idc = -1;
         style = 32+2;
         x=.15;
         y=.164;
         w=.7;
         h = 0.06;
         text = "";
         colorBackground[] = {1, 1, 1, 1};
         colorText[] = {.08, .08, .12, 1};
         font = FontM;
         sizeEx = 1.0714 * 0.03;
         };
class RscActiveText    { type = CT_ACTIVETEXT;
         idc = -1;
         style = ST_LEFT;
         color[] = {1, 1, 1, 1};
         colorActive[] = {1, 0, 0, 1};
         font = FontM;
         sizeEx = 0.04;
         soundEnter[] = {"ui\ui_over", 0.2, 1};soundPush[] = {, 0.2, 1};soundClick[] = {"ui\ui_ok", 0.2, 1}; soundEscape[] = {"ui\ui_cc", 0.2, 1}; default = false;          };
class RscSlider       { type = CT_SLIDER;
        Â
         idc = -1;
         style = ST_HPOS;
         selection ="display";
         Zoom =0.1;
        Â
         color[] = {0, 0, 0, 0.8};
         colorBackground[] = {1, 1, 1, 0.75};
            colorText[] = {0.08, 0.08, 0.12, .75};
            size = 0.8;
            angle = 0;
            font = FontS;
           Â
            };
class RscButton    { type = CT_BUTTON;idc = -1;style = ST_CENTER;colorText[] = {0, 0, 0, 1};font = FontHTML; sizeEx = 0.015; soundPush[] = {, 0.2, 1}; soundClick[] = {"ui\ui_ok", 0.2, 1}; soundEscape[] = {"ui\ui_cc", 0.2, 1}; default = false; };
  Â
class Speed
{
   idd = -1;
   movingEnable = 1;
   controlsBackground[] = {};
   objects[] = {};
   controls[]={AccelerateTime , DistanceText,dot,SpeedText ,vel,xpos,ypos,zoom,RotationText ,UpDownText ,ZoomText
      };
   class RotationText : RscTextSmall   {
  Â
   x = 0.76 ; y = 0.36; w = 0.22; h = 0.03; sizeEx = 0.02;text = "Up Down caméra"; action = "";
  Â
      };
   class xpos : RscSlider {
   idc = 97;
   x = 0.76 ; y = 0.39; w = 0.22; h = 0.035; sizeEx = 0.02; action = "";
  Â
      };
   class UpDownText : RscTextSmall   {
  Â
   x = 0.76 ; y = 0.43; w = 0.22; h = 0.03; sizeEx = 0.02;text = "Rotation caméra"; action = "";
  Â
      };
   class ypos : RscSlider {
   idc = 98;
   x = 0.76 ; y = 0.46; w = 0.22; h = 0.035; sizeEx = 0.02; action = "";
  Â
      };  Â
   class ZoomText : RscTextSmall   {
  Â
   x = 0.76 ; y = 0.50; w = 0.22; h = 0.03; sizeEx = 0.02;text = "Zoom"; action = "";
  Â
      };
   class zoom: RscSlider {
   idc = 99;
   x = 0.76 ; y = 0.53; w = 0.22; h = 0.035; sizeEx = 0.02; action = "";
  Â
      };
   class AccelerateTime : RscSlider {
   idc = 100;
   x = 0.76 ; y = 0.81; w = 0.22; h = 0.035; sizeEx = 0.02; action = "";
  Â
      };
   class DistanceText: RscEdit   {
   idc = 101;
   style = ST_MULTI + ST_NO_RECT;
   x = 0.76 ; y = 0.74; w = 0.22; h = 0.035; sizeEx = 0.02; action = "";
  Â
      };
   class SpeedText : RscEdit   {
   idc = 102;
   style = ST_MULTI + ST_NO_RECT;
   x = 0.76 ; y = 0.67; w = 0.22; h = 0.035; sizeEx = 0.02; action = "";
  Â
      };
   class Vel: RscEdit   {
   idc = 103;
   style = ST_MULTI + ST_NO_RECT;
   x = 0.76 ; y = 0.60; w = 0.22; h = 0.035; sizeEx = 0.02; action = "";
  Â
      };class Dot : RscTextSmall      {
  Â
   x = 0.5 ; y = 0.5; w = 0.01; h = 0.01; sizeEx = 0.02; text = "+"
  Â
      };  Â
};
And here is the line I use in my cpp file:
class EventHandlers
      {
      init="[_this select 0] exec ""\BAB\Script\bulletcam\sniperInit.sqs""; PosBullcam=loadFile ""\BAB\script\bulletcam\PosBullcam.sqf""";
      };
I put that line under class CfgVehicles in my cpp file.
You got right about that when i get out of a Vehicle the the "Bullet Camera On" got twis
Thats all info i can get you. The Bulletcam i use, did i found here, i serarh for Bulletcam i i found one I like "Bullet Camera uiox 1.2 " Big thank to Uiox for this nice bulletcam. its with two demo mission. I only want one camera.
Iam not good i scripting i only copy and past
and try a lot of time..
But it's work only if i don't add the same sniper in my mission or when i got out from a Vehicle.
But i dont know how to fix that problem.
Somebody have?? please msg me
Sorry about my English