Krixes - Self Bloodbag Script

try to replace der Krixes Selfaction with this:

Code:
    if((speed player <= 1) && ("bloodBagONEG" in magazines player) && _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;
    };
 
Your Selfbloodbag script is fine. but somehow you have managed to remove the scroll wheel menu from selfactions. im new here and still learning myself so im sorry but you gonna need a smarter man then my self to help you. your best bet would be to start again adding 1 mod at a time. start with the selfbloodscript. Sorry i wan't much help
Dave.
 
Is this functioning with vanilla 1.8.3. In 1.8.2 for some reason isn't wasn't removing the bloodbag but other than that it was fine. I changed the name from bloodbag to bloodbagOneg and just made those available.
 
one thing about this script is that it sometimes broke the trader menus. so please check that all your functions work every time you add a new script.
as far as
traders working
being able to get into vehicles with 2 or more people..

im just giving you a heads up on the the problems i used to encounter.. i believe thats why they made the self transfuse script..
 
Last edited:
I looked at it for a while yesterday and I guess that without modifying the DayZ mod for yourself and all clients then there really isn't any way to get it working; other than possibly setting it server side in a script mod and broadcasting it, or calling it for each client that connects.
 
I was on a server a couple days ago, that had a scroll wheel option for self blood bag.. running 1.8.3... I'll have a look and see if I can find out for you.
 
// Krixes Self Bloodbag
if (("ItemBloodbag" in _mags) || ("bloodBagOPOS" in _mags) || ("bloodBagONEG" in _mags) || ("bloodBagABPOS" in _mags) || ("bloodBagABNEG" in _mags) || ("bloodBagBPOS" in _mags) || ("bloodBagAPOS" in _mags) || ("bloodBagANEG" in _mags) || ("wholebloodBagOPOS" in _mags) || ("wholebloodBagONEG" in _mags) || ("wholebloodBagABPOS" in _mags) || ("wholebloodBagABNEG" in _mags) || ("wholebloodBagBPOS" in _mags) || ("wholebloodBagAPOS" in _mags) || ("wholebloodBagANEG" 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\fn_self\player_selfbloodbag.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_selfBloodbag;
s_player_selfBloodbag = -1;
};

You're welcome!
 
Final verification: Am I putting this in dayz_code.pbo server side or the mission? I presume the mission. (I'm quite new to the DayZ editing side and its framework)

P.S; Here's a faster method rather than all of those if statements for the bloodbag removal on the above script, if anybody's interested.

http://pastebin.com/aMNHDrJW
 
Last edited:
very interesting I'll save that for future reference. Although I don't run vanilla and that's the only version with multiple types of bloodbags.

You pull the fn_selfactions.sqf out of your client side dayz_code PBO, usually steam > steamapps > common > arma2OA > @Dayz or something like that... pull that , slap it in the mission PBO. You'll also need to pull out the compiles.sqf.. In your init.sqf redirect to wherever you put the compiles.sqf.. in the compiles.sqf redirect to wherever you put your fn_Selfactions. Hope that makes sense.
 
That makes sense; the only part that confuses me when I was thinking about that yesterday is the overwriting of global or public variables.


Code:
call compile preprocessFileLineNumbers "Scripts\compiles.sqf"; //Compile custom compiles
I presume of course that putting the following AFTER the dayz_code compiles call in the init.sqf will overwrite the mod defined actions, but as I'm unsure about the DayZ framework and timers or waitUntil's then I'm unsure as to whether dayz_code compiles will still overwrite my custom compiles on start or even for JIP clients, although I guess the JIP issue could be fixed with the initPlayerLocal event script

--Update--

I think I understand it now actually, disable the server called compiles and put the entire compiles in the mission instead.

--Update #2--

For people getting errors about s_player_bloodBag being an invalid variable, then place the dayz_code variables.sqf in your mission and change the missions init.sqf to reference the new variables.sqf path; then in there you have a function full of variables set to -1, do the same for s_player_bloodBag.
 
Last edited:
Yea sorry I forgot about variables, I havn't had to do all of this from the beginning in some time. But yes, any time you want to modify a client side script, you have to move it from your dayz_code to your mission PBO, and completely redirect server call for that script.

You could also, although I don't like to, make a separate compiles.sqf, adding only the call lines you wish to edit, and call it after the original call line for the server. The server will compile the second one after the first. This would keep your mission size down but not by much. I prefer to bring the entire thing over and just make edits to it.
 
The best way to keep the mission file size down in this case is either by putting it in to the DayZ_Server in the @hive mod; or else you could make your own script mod that runs server side only and reference the mod path in the mission init.sqf.

All your customization goes in the server side script mod and calls as it should usually.
 
i have installed the selfblood bag script and i got it working , only thing is the scroll option to give myself blood is always there even if i do not need the blood, , is there a way to make it where i can only give myself blood if i am low on blood?
 
i have installed the selfblood bag script and i got it working , only thing is the scroll option to give myself blood is always there even if i do not need the blood, , is there a way to make it where i can only give myself blood if i am low on blood?




FN_SELFACTION

// ---------------------------------------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) && (r_player_blood < 12000)) 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------------------------------------



This should not let it pop up if your blood is 12000
 
Back
Top