Krixes - Self Bloodbag Script

I really appreciate the help man!

Sorry man, dinner took longer than I thought it would haha.

I'd forgotten that you can't use normal script checks with the command menus, so sadly the option will always show in the menu. However I've edited the player_selfBloodBag.sqf to include the check for having the item and for whether they need blood or not.

Here is the file you can use.

This is a breakdown of the changes (because it's always nice to know what the code changes are).
It's the 1.8 file I had already updated, plus this
Added this to the private blarg line
Code:
,"_hasBagItem","_needsBlood"

After this
Code:
_inCombat = if (_timeout >= diag_tickTime) then { true } else { false };

I added
Code:
_hasBagItem = "ItemBloodbag" in magazines player;
_needsBlood = if (r_player_blood < 12000) then { true } else { false };
 
if (!_hasBagItem) exitWith { //If player doesn't have bloodbag then they can't self blood
    cutText [format["You need a bloodbag to do this."], "PLAIN DOWN"]; //display text to let player know they need a blood bag
};
 
if (!_needsBlood) exitWith { //If they don't need blood then they can't self blood
    cutText [format["Are you crazy? You already have full blood."], "PLAIN DOWN"]; //display text to let player know they have full blood
};

Tested it out using one of my own command menus and it worked fine. :)

I now just hope you're running 1.8, if not then you'll need to make the changes to the standard file. But instead of finding
Code:
_inCombat = if (_timeout >= diag_tickTime) then { true } else { false };
Find
Code:
_bloodbagUsageTime = time;
 
i updated to it 1.8 dowloaded stock pbo tried to add self bloodbag, i saw the option but it did nothing

Oh, I already told you to look at the link in my signature for the 1.8 self blood fix. Just download the file in that post and replace the player_selfBloodBag.sqf you already have with it.
 
Ok im trying to add self blood bagging to my epoch server but everytime i go in game i can self blood bag but i can not unlock my vehicles or anything
 
Ok im trying to add self blood bagging to my epoch server but everytime i go in game i can self blood bag but i can not unlock my vehicles or anything

You used the fn_selfActions.sqf from Krixes' post I'm guessing? You're not supposed to do that. What you need to do is open your local install of Arma and find this
@DayZ_Epoch\addons\dayz_code.pbo\compile\fn_selfActions.sqf
Copy that file to where you have put Krixes' file in your mission folder then open it up and find
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

Then directly under that you want to add
Code:
// ---------------------------------------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>"),"custom\player_selfbloodbag.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_selfBloodbag;
        s_player_selfBloodbag = -1;
    };
// ---------------------------------------Krixes Self Bloodbag End------------------------------------


Save and you're done.
 
Hey, i got the selfBB working but now i cant access the tradermenu oder lock/unlock vehicles.

This is the init.sqf out of the installation:


Code:
call compile preprocessFileLineNumbers "server_traders.sqf";                //Compile trader configs
call compile preprocessFileLineNumbers "Scripts\compiles.sqf";                        //Compile custom compiles
progressLoadingScreen 1.0;


I also tried it this way:


Code:
call compile preprocessFileLineNumbers "server_traders.sqf";                //Compile trader configs
progressLoadingScreen 1.0;
call compile preprocessFileLineNumbers "Scripts\compiles.sqf";                        //Compile custom compiles




i tried both types and selBB works but not the traders. Is it a Problem with my init or ist it because of my compile.sqf:

Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Scripts\fn_selfActions.sqf";

this is my complete compile.sqf
 
Ok i did all that then what not and when i start my server up we are black screening now

Replacing just the fn_selfActions.sqf shouldn't ever result in a black screen hang. Upload your mission files I'll take a quick look.

Hey, i got the selfBB working but now i cant access the tradermenu oder lock/unlock vehicles.

This is the init.sqf out of the installation:


Code:
call compile preprocessFileLineNumbers "server_traders.sqf";                //Compile trader configs
call compile preprocessFileLineNumbers "Scripts\compiles.sqf";                        //Compile custom compiles
progressLoadingScreen 1.0;


I also tried it this way:


Code:
call compile preprocessFileLineNumbers "server_traders.sqf";                //Compile trader configs
progressLoadingScreen 1.0;
call compile preprocessFileLineNumbers "Scripts\compiles.sqf";                        //Compile custom compiles




i tried both types and selBB works but not the traders. Is it a Problem with my init or ist it because of my compile.sqf:

Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Scripts\fn_selfActions.sqf";

this is my complete compile.sqf

Look at my post two above yours.
 
Back
Top