Krixes - Self Bloodbag Script


Staff member
Krixes - Self Bloodbag Script
Version 1.4

All of the edits can be done in player_selfBloodbag.sqf under the Config area!

Change Log 1.5:
  1. Updated for DayZ 1.8
  2. Changed combat variable for use in 1.8.
  3. Updated by CommanderRetra
Change Log 1.4:
  1. Added bloodbag use timer
  2. Added a timer for the amount of time before player can use self bloodbag again
Change Log 1.3:
  1. Added a lot more comments!
  2. Added config area and variables for custom user changes
  3. Added a fancy interrupt method
  4. Removed unnecessary methods
Special Thanks:
  1. Player2 for the infection chance and some of the comments!
  2. istealth for the combat check!
  3. Dantw for his testing on multiple mods!
Confirmed working on the listed mods below by Dantw!
Lingor Island*
Panthera Island*
Taviana both Version*

DayZ Epoch*
DayZ Origin*

*Note - For most of the other mods other than stock Chernarus you will need to use your own fn_selfActions.sqf located inside your @modnamehere/dayz_code.pbo files and then follow the custom fn_selfAction.sqf tutorial below.

Confirmed working on the listed mods below by Krixes!
DayZ 1.7.7:

*Note - For DayZ 1.7.7 you must copy and use the fn_selfActions.sqf located inside your @DayZ/dayz_code.pbo folder and then follow the custom fn_selfActions.sqf!

Please like this post if you like and it works for you, it would be appreciated!

Please post questions, comments and suggestions below!

Installation Instructions For new dayz_mission.pbo:
Open your dayz_mission.pbo and find init.sqf

add this just before progressLoadingScreen 1.0;
call compile preprocessFileLineNumbers "Scripts\compiles.sqf"; //Compile custom compiles
Now create a folder in your dayz_mission.pbo called Scripts and create a new empty file called compiles.sqf inside.

Edit the compiles.sqf to look like this.....
fnc_usec_selfActions = compile preprocessFileLineNumbers "Scripts\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
add the attached fn_selfActions.sqf to your custom folder.

Now lastly add the attached player_selfbloodbag.sqf into your custom folder.

Go in game give yourself a bloodbag and use the scroll wheel to select Self Bloodbag and you should be all set!

Installation Instructions For existing custom dayz_mission.pbo and fn_selfActions.sqf:
Open your dayz_mission.pbo

Create a new folder called Scripts in your dayz_mission.pbo and add my player_selfBloodbag.sqf to the custom folder you just created!

open your fn_selfActions.sqf in YOUR dayz_mission.pbo and add this in....
// ---------------------------------------Krixes Self Bloodbag Start------------------------------------
    _mags = magazines player;
    // Krixes Self Bloodbag
    if ("ItemBloodbag" in _mags) then {
        hasBagItem = true;
    } else { hasBagItem = false;};
    if((speed player <= 1) && hasBagItem && _canDo) then {
        if (s_player_selfBloodbag < 0) then {
            s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"Scripts\player_selfbloodbag.sqf","",5,false,true,"", ""];
    } else {
        player removeAction s_player_selfBloodbag;
        s_player_selfBloodbag = -1;
// ---------------------------------------Krixes Self Bloodbag End------------------------------------
just after this part...........
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
Have Fun,