Jump to content
  • 0

Troubles..


Desire

Question

So, I have been wanting to add MF-TOW to my server for about a day now, but I have been stuck on something... It says " This is the built in DayZ Epoch towing call, ensure that it is commented out so that it doesn't interfear with MF-Tow. Below this block of code, add the following line to initiate the MF-Tow script. " How do I comment out a code... It's also asking to put the following line below the block of code, how would I do that? I'm new to all this, so please help me, as I plan to get better. Here is the code by the way.

 

                                                                                                           Comment out this 

   //Towing with tow truck
    /*
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];               
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];              
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
    */

Then add this below the block.. 

// MF-Tow Script by Matt Fairbrass (matt_d_rat)
call compile preprocessFileLineNumbers 'addons\mf-tow\init.sqf';

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

hi there, to comment out something is actually pretty easy:

 

There are 2 ways to do so:

1.) // Everything after // is commented out but only in this Line!

//This line is commented out
_code = player distance _object; //Text after Code is Commented out

2.) Comment out serveral lines using /* at the beginning and */ at the end. Everything inbetween of them is commented out  

/* 
INBETWEEN COMMENTED OUT LINE 1
INBETWEEN COMMENTED OUT LINE 1
INBETWEEN COMMENTED OUT LINE 1
INBETWEEN COMMENTED OUT LINE 1
 */  

You can observe both methods in your mentioned Block:

   //Towing with tow truck
    /*
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];               
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];              
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
    */

To insert something below the Block means to insert it right under/after the mentioned code.

In your case it would look like this:

   //Towing with tow truck <- Commented out
    /* <- Begin comment out
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];               
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];              
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
     End comment out -> */
// MF-Tow Script by Matt Fairbrass (matt_d_rat) <- commented out again
call compile preprocessFileLineNumbers 'addons\mf-tow\init.sqf'; //<- Actual Code with my commented out comment xD
Link to comment
Share on other sites

  • 0

 

hi there, to comment out something is actually pretty easy:

 

There are 2 ways to do so:

1.) // Everything after // is commented out but only in this Line!

//This line is commented out
_code = player distance _object; //Text after Code is Commented out

2.) Comment out serveral lines using /* at the beginning and */ at the end. Everything inbetween of them is commented out  

/* 
INBETWEEN COMMENTED OUT LINE 1
INBETWEEN COMMENTED OUT LINE 1
INBETWEEN COMMENTED OUT LINE 1
INBETWEEN COMMENTED OUT LINE 1
 */  

You can observe both methods in your mentioned Block:

   //Towing with tow truck
    /*
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];               
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];              
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
    */

To insert something below the Block means to insert it right under/after the mentioned code.

In your case it would look like this:

   //Towing with tow truck <- Commented out
    /* <- Begin comment out
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];               
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];              
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
     End comment out -> */
// MF-Tow Script by Matt Fairbrass (matt_d_rat) <- commented out again
call compile preprocessFileLineNumbers 'addons\mf-tow\init.sqf'; //<- Actual Code with my commented out comment xD

Ahh, thank you so much! I'm going to go try this right now! So basically, what you're saying is that the towing with tow truck code is already commented out, and the only code I really need for the mf-tow is 

call compile preprocessFileLineNumbers 'addons\mf-tow\init.sqf'

?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...