It really is no problem at all! Im glad I could help. =)Yep, that seemed to do it! Thanks again for the help. Twice. And I am forever in your debt!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
It really is no problem at all! Im glad I could help. =)Yep, that seemed to do it! Thanks again for the help. Twice. And I am forever in your debt!
To change the infection chance, just change the 10 to xx?
if (random 10 < 1) then { //10% chance
r_player_infected = true; //set players client to show infection
player setVariable["USEC_infected",true,true]; //tell the server the player is infected
};
i did this and it works fine in my server no problemHi, im trying to add a cooldown and not be available to use in combat but anything i add seems to break it.
In combat:
if (player getVariable["combattimeout", 0] >= time) then {
hintSilent "You can't bloodbag yourself in combat!";
} else {
Tried adding to start of player_selfbloodbag.sqf but breaks. As for the cooldown adding sleep 300; didnt seem to work.
// Script writen by Krixes
// Infection chance and comments added by Player2
// Version 1.1
//
if ((dayz_combat == 1)) then {
cutText [format["You are in Combat cannot give yourself a Bloodbag"], "PLAIN DOWN"]; //display text at bottom center of screen
} else {
player removeAction s_player_selfBloodbag; //remove the action from users scroll menu
player playActionNow "Medic"; //play bloodbag animation
sleep 5; //wait 5 seconds for animation to finish
player removeMagazine "ItemBloodbag"; //remove the used bloodbag from inventory
r_player_blood = r_player_bloodTotal; //set their blood to the maximum allowed
r_player_lowblood = false; //set lowblood setting to false
10 fadeSound 1; //slowly fade their volume back to maximum
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; //disable post processing blur effect
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; //give them their colour back
r_player_lowblood = false; //just double checking their blood isnt low
player setVariable["USEC_BloodQty",r_player_bloodTotal,true]; //set their blood back up to maximum again
cutText [format["You have used a bloodbag on yourself!"], "PLAIN DOWN"]; //display text at bottom center of screen
if (random 10 < 1) then { //10% chance
r_player_infected = true; //set players client to show infection
player setVariable["USEC_infected",true,true]; //tell the server the player is infected
};
if (isServer) then { //if running on server
player setVariable["medForceUpdate",true]; //force the server to update the players medical status
};
};
Without any real knowledge, just common sense I would expect that changing this value would change how much blood it gives you?Is there anyway to make this only give like 3-4k blood? etc
r_player_blood = r_player_bloodTotal; //set their blood to the maximum allowed
player setVariable["USEC_BloodQty",r_player_bloodTotal,true]; //set their blood back up to maximum again
Without any real knowledge, just common sense I would expect that changing this value would change how much blood it gives you?
Code:r_player_blood = r_player_bloodTotal; //set their blood to the maximum allowed
Not sure what kind of value it would take though, since you're adding blood to their current amount of blood.
Maybe r_player_blood = r_player_blood + 4000; (not sure how SQF syntax would form that)
See my above edit also.
Nice push in the right direction Sarge!Code:r_player_blood = 12000; r_player_lowblood = false; r_player_timeout = 0; r_player_bloodTotal = r_player_blood;
defines the value in \dayz_code\init\variables.sqf.
is there anyway you could also make it so you can cancel it so like if you hit w or try to walk it will cancel it because if your bloodbag yourself and someone is running to you cant do anything but dieNice push in the right direction Sarge!
I will do a re-write for this script and make it more non-coder friendly since there is such interest in this code. Give me a few hours as I am busy at this exact moment.
-Krixes