Inkko
Valued Member!
I update my server the other day to 1.8.3 and Humanity changes seem to not function at all. Anyone else had this issue or is it just me? I'm about to just script in a while loop to fix it since its being a pain.
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.
[] spawn {
waituntil {alive player;!isNull (finddisplay 46);};
debugloop =
{
// 20 sec loop to check for players in debug...
_debuglp = 0;
while {_debuglp < 20} do {
_debug = getmarkerpos "respawn_west";
_charPos = position player;
_distance = _debug distance _charPos;
// if in debug go to debugfix continue loop just incase?
if (_distance < 3000) then {
player call debugfix;
sleep 5;
};
diag_log format['Debug Spawn Check: %1',_debuglp];
_debuglp = _debuglp + 1;
sleep 1;
};
};
debugfix = {
_debug = getmarkerpos "respawn_west";
_charPos = position player;
_distance = _debug distance _charPos;
//_model = typeOf player;
if (_distance < 3000) then {
systemChat 'Debug: You are in debug. Fixing your position...';
_mkr = getMarkerPos ("spawn" + str(floor(random 6)));
_position = ([_mkr,0,1400,10,0,2,1] call BIS_fnc_findSafePos);
sleep 1;
if !((typeof(unitBackpack player)) in DayZ_Backpacks) then {
sleep 1;
player addBackPack "DZ_Assault_Pack_EP1";
{player addWeapon _x;} forEach ["ItemFlashlight","ItemCompass","ItemMap","ItemMachete","M9"];
{player addMagazine _x;} forEach ["15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9","ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemAntibiotic","ItemBloodbag","FoodSteakCooked","ItemPainkiller","ItemWaterbottle","PartGeneric"];
};
// not necessary with seperate humanity check now?
/*if (_model in ["Survivor1_DZ","Survivor2_DZ","Bandit1_DZ","Survivor3_DZ","SurvivorW2_DZ","BanditW1_DZ"]) then {
[player,0] call player_humanityChange;
};*/
player setPosATL [_position select 0,_position select 1,1500];[player,1500] spawn BIS_fnc_halo;
systemChat 'Debug: New location found. Halo jumping into area... Dont forget to open your parachute!';
};
};
player call debugloop;
};
[] spawn {
waituntil {alive player;!isNull (finddisplay 46);};
// lets fix humanity...
humanityfixloop = {
_model = typeOf player;
_humanity = player getvariable["humanity",0];
// why the fuck is this not being sent from the server? PVCDZ_plr_Humanity
// skip any models that aren't supported by humanity changes...
if (_model in ["Survivor2_DZ","Bandit1_DZ","Survivor3_DZ","SurvivorW2_DZ","BanditW1_DZ"]) then {
_isMen = _model == "Survivor2_DZ";
_isMenH = _model == "Survivor3_DZ";
_isMenB = _model == "Bandit1_DZ";
_isWomen = _model == "SurvivorW2_DZ";
_isWomenH = _model == "SurvivorW3_DZ"; //TODO
_isWomenB = _model == "BanditW1_DZ";
//bandit
if (_humanity <= -2000) then {
if (_isMen || _isMenH) then {
[dayz_playerUID,dayz_characterID,"Bandit1_DZ"] spawn player_humanityMorph;
sleep 5;
};
if (_isWomen || _isWomenH) then {
[dayz_playerUID,dayz_characterID,"BanditW1_DZ"] spawn player_humanityMorph;
sleep 5;
};
} else {
//survivor
if ((_humanity > -2000) && (_humanity <= 5000)) then {
if (_isMenH || _isMenB) then {
[dayz_playerUID,dayz_characterID,"Survivor2_DZ"] spawn player_humanityMorph;
sleep 5;
};
if (_isWomenH || _isWomenB) then {
[dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph;
sleep 5;
};
} else {
//hero
if (_humanity > 5000) then {
if (_isMen || _isMenB) then {
[dayz_playerUID,dayz_characterID,"Survivor3_DZ"] spawn player_humanityMorph;
sleep 5;
};
if (_isWomenB) then {
[dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph;
sleep 5;
};
};
};
};
};
sleep 5;
// this is the only wait so that the script stops here each time before continueing to check before repeating on change
waituntil {(_humanity != (player getVariable["humanity",0]));};
player call humanityfixloop;
};
// initilize fix
player call humanityfixloop;
};
_isMen = _model == "Survivor2_DZ";
_isMenH = _model == "Survivor3_DZ";
_isMenB = _model == "Bandit1_DZ";
_isWomen = _model == "SurvivorW2_DZ";
_isWomenH = _model == "SurvivorW3_DZ"; //TODO
_isWomenB = _model == "BanditW1_DZ";
The defines that are highlighted are for the humanity changes to make sure you're in a skin that can change into the humanity morph; if you have -4k humanity and your skin is hero or survivor you change to bandit vs if your skin is bandit it does nothing or if your skin is something other then those. I would just do what someone else said and just set the required humanity extremely high so that humanity morphs just never happen.I gave you the file, I would just set the skin for bandit the same as survivor then it doesnt matter what the number is.
But all you had to do was open that file and look right below the part I posted.
// Bandit
if (_humanity <= -2000) then {
Actually I dont know what those defines for skins are used for because in the set bandit code you specify the skin there rather than using the defined values.... but yeah, I would just use the survivor skin for the bandit ..
![]()
if (_item == "Skin_Survivor2_DZ") then {
if (_isBandit) then {
_model = "Bandit1_DZ";
};
if (_isHero) then {
_model = "Survivor3_DZ";
};
};
if (_item == "Skin_Survivor2_DZ") then {
if (_isBandit) then {
_model = "Survivor2_DZ";
};
if (_isHero) then {
_model = "Survivor2_DZ";
};
};
class ExtraRc {
class Skin_Camo1_DZ {
class skin1 {
text = "Hero Camo";
script = "['camoh','Skin_Camo1_DZ','FR_GL'] execVM 'custom\skins.sqf';";
};
class skin2 {
text = "Bandit Camo";
script = "['camob','Skin_Camo1_DZ','GUE_Soldier_CO'] execVM 'custom\skins.sqf';";
};
};
class Skin_Sniper1_DZ {
class skin3 {
text = "Hero Ghillie";
script = "['sniperh','Skin_Sniper1_DZ','GUE_Soldier_Sniper'] execVM 'custom\skins.sqf';";
};
class skin4 {
text = "Bandit Ghillie";
script = "['sniperb','Skin_Sniper1_DZ','Ins_Soldier_Sniper'] execVM 'custom\skins.sqf';";
};
};
class Skin_Soldier1_DZ {
class skin5 {
text = "Hero Soldier";
script = "['soldierh','Skin_Soldier1_DZ','GUE_Commander'] execVM 'custom\skins.sqf';";
};
class ski6 {
text = "Bandit Soldier";
script = "['soldierb','Skin_Soldier1_DZ','TK_Soldier_EP1'] execVM 'custom\skins.sqf';";
};
};
class Skin_Survivor2_DZ {
class skin7 {
text = "Wear Taki Civ";
script = "['normal','Skin_Survivor2_DZ','TK_GUE_Soldier_Sniper_EP1'] execVM 'custom\skins.sqf';";
};
class skin8 {
text = "Wear Bodyguard";
script = "['normal','Skin_Survivor2_DZ','Soldier_Bodyguard_M4_PMC'] execVM 'custom\skins.sqf';";
};
class skin9 {
text = "Wear Bodyguard 2";
script = "['normal','Skin_Survivor2_DZ','Soldier_Bodyguard_AA12_PMC'] execVM 'custom\skins.sqf';";
};
class skin10 {
text = "Wear Hero";
script = "['normal','Skin_Survivor2_DZ','Survivor3_DZ'] execVM 'custom\skins.sqf';";
};
class skin11 {
text = "Wear Bandit";
script = "['normal','Skin_Survivor2_DZ','Bandit1_DZ'] execVM 'custom\skins.sqf';";
};
class skin12 {
text = "Wear Bandit Female";
script = "['normal','Skin_Survivor2_DZ','BanditW1_DZ'] execVM 'custom\skins.sqf';";
};
class skin13 {
text = "Wear Female Clothing";
script = "['normal','Skin_Survivor2_DZ','SurvivorW2_DZ'] execVM 'custom\skins.sqf';";
};
};
};
private ["_skin","_removeSkin","_choice"];
if (isnil "LastSkinChange") then {
LastSkinChange = nil;
};
_skin = _this select 0;
_removeSkin = _this select 1;
_choice = _this select 2;
_humanity = player getVariable["humanity",0];
_model = typeOf player;
_AddSkin = "Skin_Survivor2_DZ"; // default
_SkinLastUsedTime = 30; // Amount of time in seconds before player can use lockpick again after a succesful use
// ---------------------- config end ---------------------
if (isnil "LastSkinChange") then {
_SkinChangeTime = 0;
} else {
_SkinChangeTime = time - LastSkinChange; // Variable used for easy reference in determining the self bloodbag cooldown
};
_lockpickUsageTime = time;
_timeout = player getVariable["combattimeout", 0];
_inCombat = if (_timeout >= diag_tickTime) then { true } else { false };
if(_SkinChangeTime < _SkinLastUsedTime) exitWith { // If cooldown is not done then exit script
cutText [format["You may not change skins so soon please wait %1 more seconds!",round((_SkinChangeTime - _SkinLastUsedTime)*-1)], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
};
if (_inCombat) then { // Check if in combat
cutText [format["You are in Combat and cannot continue your action!"], "PLAIN DOWN"]; //display text at bottom center of screen when in combat
} else {
// added model check to give correct parcels when changing between skins
if(_model in ["Sniper1_DZ","GUE_Soldier_Sniper","Ins_Soldier_Sniper"]) then{
_AddSkin = "Skin_Sniper1_DZ";
};
if(_model in ["Camo1_DZ","GUE_Soldier_CO","FR_GL"]) then{
_AddSkin = "Skin_Camo1_DZ";
};
if(_model in ["Soldier1_DZ","GUE_Commander","TK_Soldier_EP1"]) then{
_AddSkin = "Skin_Soldier1_DZ";
};
if (_skin == "camoh") then {
if(_humanity >= 5000) then{
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to gain %2 more.",_humanity,(5000 - _humanity)], "PLAIN DOWN"];
};
};
if (_skin == "camob") then {
if(_humanity <= -2500) then{
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to lose %2 .",_humanity,(-2500 - _humanity)], "PLAIN DOWN"];
};
};
if (_skin == "soldierh") then {
if(_humanity >= 5000) then{
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to gain %2 more.",_humanity,(5000 - _humanity)], "PLAIN DOWN"];
};
};
if (_skin == "soldierb") then {
if(_humanity <= -2500) then{
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to lose %2 .",_humanity,(-2500 - _humanity)], "PLAIN DOWN"];
};
};
if (_skin == "sniperh") then {
if(_humanity >= 5000) then{
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to gain %2 more.",_humanity,(5000 - _humanity)], "PLAIN DOWN"];
};
};
if (_skin == "sniperb") then {
if(_humanity <= -2500) then{
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to lose %2 .",_humanity,(-2500 - _humanity)], "PLAIN DOWN"];
};
};
if (_skin == "normal") then {
if (_choice in ["Survivor3_DZ","SurvivorW3_DZ"]) then {
if(_humanity >= 5000) then {
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to gain %2 more.",_humanity,(5000 - _humanity)], "PLAIN DOWN"];
};
} else {
if (_choice in ["SurvivorW2_DZ","Bandit1_DZ"]) then {
if(_humanity <= -2500) then {
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
} else {
closeDialog 0;
cutText [format["You do not have the required humanity. Your humanity is %1, you need to lose %2 .",_humanity,(-2500 - _humanity)], "PLAIN DOWN"];
};
} else {
player removeMagazine _removeSkin;
player addMagazine _AddSkin;
uisleep 0.5;
[dayz_playerUID,dayz_characterID,_choice] spawn player_humanityMorph;
player removeWeapon "ItemRadio";
};
};
};
};