Krixes - Self Bloodbag Script

Like this....
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0;

Yes there is I believe Manatee Hunter posted it back on..... page 1
Not being funny but thats what I did...
 
J
Just did, thats exactly what I did
K did you give me the wrong download link.. re-downloaded and still I see this in your init.sqf.....
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
progressLoadingScreen 1.0;
When it's supposed to look like this.........
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0;
 
K did you give me the wrong download link.. re-downloaded and still I see this in your init.sqf.....
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
progressLoadingScreen 1.0;
When it's supposed to look like this.........
Code:
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0;
Oh! I didnt realize underneath it said 1.o, I got confused with the 0.1, my bad thanks for the help!
 
When I restart the server I get stuck on receiving character data. It won't go past that point. Any help would be greatly appreciated, awesome work Krixes. I hope to get this working.
 
Awesome work Krixes.. thank you.. ;)

I see you are still able to give yourself a blood bag when you have 12000 blood.

Can this be edited to only give a blood bag if you are below 12000?
 
When I restart the server I get stuck on receiving character data. It won't go past that point. Any help would be greatly appreciated, awesome work Krixes. I hope to get this working.
I would need to see your dayz_mission.pbo sir! (It's much easier to debug that way)
Awesome work Krixes.. thank you.. ;)

I see you are still able to give yourself a blood bag when you have 12000 blood.

Can this be edited to only give a blood bag if you are below 12000?
Holy crap that's feature I had forgot to add! lawl

There are a couple of ways to do this. One is leaving the option available just so you know its there but not actually allowing you to use the bloodbag using an exit script method with text. The other is not allowing the option to even be there depending on blood levels.

I will write you some code to add depending on which type you prefer.... and I will also do a small update that fixes this issue a bit later
Hi

is it possible to only active self bloodbag when you are in an safezone ?

Yes this is possible by adding another if statement or adding a bit of code to the fn_selfActions.sqf selfblood part... I am not sure how the safezone script checks how you are in a safezone so I can't really offer you code... just hope to point you in the right direction unless I can see how the safezone script works.
 
Holy crap that's feature I had forgot to add! lawl

There are a couple of ways to do this. One is leaving the option available just so you know its there but not actually allowing you to use the bloodbag using an exit script method with text. The other is not allowing the option to even be there depending on blood levels.

I will write you some code to add depending on which type you prefer.... and I will also do a small update that fixes this issue a bit later

I believe the best way would be, not allowing the option below 12000 blood.
(ie: it doesn't function, the same way bandaging doesn't function when your not bleeding)

Edit: That was supposed to be, not allowing it "above" 12000. :)
 
I believe the best way would be, not allowing the option below 12000 blood.
(ie: it doesn't function, the same way bandaging doesn't function when your not bleeding)
Ok, open the player_selfbloodbag.sqf and just above this part..............
Code:
if(_bloodbagTime < _bloodbagLastUsedTime) exitWith { // If cooldown is not done then exit script
    cutText [format["You may not use Self Bloodbag this soon please wait %1!",(_bloodbagTime - _bloodbagLastUsedTime)], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
};
add this......
Code:
if(r_player_blood > 11500) exitWith {
    cutText [format["You are not low enough health to give yourself a Bloodbag!"], "PLAIN DOWN"]; //display text at bottom center of screen when health is not within range
};
So that it looks like this........
Code:
if(r_player_blood > 11500) exitWith {
    cutText [format["You are not low enough health to give yourself a Bloodbag!"], "PLAIN DOWN"]; //display text at bottom center of screen when health is not within range
};
 
if(_bloodbagTime < _bloodbagLastUsedTime) exitWith { // If cooldown is not done then exit script
    cutText [format["You may not use Self Bloodbag this soon please wait %1!",(_bloodbagTime - _bloodbagLastUsedTime)], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
};

You will need to play with the 11500 until you get it just right, as I have found a players life never stays at 12000 exactly. (it's always off by a slight amount and adding 12000 will defeat the purpose)

**Edit - Sorry this one took so long to get back.. needed moderator approval for some reason! :p

Moderator:
Why am I being moderated lol? Am I replying to fast or to much? I'm just trying to help people out. :(
 
safezone script
PHP:
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
 
while {true} do
  {
    //wait until Player is in base, then start Eventhandler
    waitUntil {vehicle player in list _Basis};
    player groupchat "i am in Baseshield!";
    _EH_Fired  = vehicle player addEventHandler ["Fired", { NearestObject [_this select 0,_this select 4] setPos[0,0,0]}];
    _EH_Hit    = vehicle player addEventHandler ["Hit",  {_this select 1 setdammage 1; player setDammage 0; vehicle player setDammage 0}];
    _EH_Killed = vehicle player addEventHandler ["Killed",{_this select 1 setdammage 1}];
sleep 10;
_zombies = _Basis nearEntities ["zZombie_Base",150];
_count = count _zombies;
 
for "_i" from 0 to (_count -1) do
{
_zombie = _zombies select _i;
_zombie setpos [-3367.739,-120.84577,-8247.0625];
};
 
    //wait until Player left base, then delete EventHandler
    waitUntil {! (vehicle player in list _Basis)};
    player groupchat "i have left Baseshield!";
    player removeEventHandler ["Fired", _EH_Fired];
    player removeEventHandler ["Hit",  _EH_Hit];
    player removeEventHandler ["Killed",_EH_Killed];
  }
how i call it
PHP:
class Item2
        {
            position[]={6344.8081,304.99023,7806.7598};
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="zonestary";
            expCond="(player distance zonestary) < 50;";
            expActiv="TitleText[""Now entering trader city Stary"",""PLAIN DOWN""]; placevault = false;[zonestary] execVM ""custom\safezone.sqf"";";
            expDesactiv="TitleText[""Now leaving trader city Stary"",""PLAIN DOWN""]; placevault = true;";
            class Effects
            {
                soundDet="arabian_market_1";
            };
        };
 
safezone script
Try replacing this line in fn_selfActions.sqf......
Code:
if ("ItemBloodbag" in _mags) then {
With this.......
Code:
if (("ItemBloodbag" in _mags) && ((player distance zonestary) < 50)) then {

If this does not work, then we can use a public variable... just let me know if it does.. im unsure if zonestary becomes a public variable as its name or not.
 
Ok, open the player_selfbloodbag.sqf and just above this part..............
Code:
if(_bloodbagTime < _bloodbagLastUsedTime) exitWith { // If cooldown is not done then exit script
    cutText [format["You may not use Self Bloodbag this soon please wait %1!",(_bloodbagTime - _bloodbagLastUsedTime)], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
};
add this......
Code:
if(r_player_blood > 11500) exitWith {
    cutText [format["You are not low enough health to give yourself a Bloodbag!"], "PLAIN DOWN"]; //display text at bottom center of screen when health is not within range
};
So that it looks like this........
Code:
if(r_player_blood > 11500) exitWith {
    cutText [format["You are not low enough health to give yourself a Bloodbag!"], "PLAIN DOWN"]; //display text at bottom center of screen when health is not within range
};
 
if(_bloodbagTime < _bloodbagLastUsedTime) exitWith { // If cooldown is not done then exit script
    cutText [format["You may not use Self Bloodbag this soon please wait %1!",(_bloodbagTime - _bloodbagLastUsedTime)], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
};

You will need to play with the 11500 until you get it just right, as I have found a players life never stays at 12000 exactly. (it's always off by a slight amount and adding 12000 will defeat the purpose)

Tested and working 100%.. thank you :)
 
That default version worked for the colouring. Thanks.
People are loving the script already :D hope to see more from you ;)

Could you post the default colour please..

Edit: The standard green is: #61A840 or so close you wouldn't notice :)
 
Is there a way to get self blood to work with out the fn_selfActions.sqf file, I am running and Epcoh server and don't what to mess with the core files to much
 
Back
Top