Jump to content
  • 0
THAC0_Gewch

Give loadout based on humanity level

Question

55 answers to this question

Recommended Posts

  • 0

Wouldn't this override their inventory every time they log in? I imagine you will need a check to verify the player is a new spawn.

 

Also youll need this under the back pack line

 

DefaultBackpackWeapon = "";

Share this post


Link to post
Share on other sites
  • 0

Wouldn't this override their inventory every time they log in? I imagine you will need a check to verify the player is a new spawn.

 

Also youll need this under the back pack line

 

DefaultBackpackWeapon = "";

 

I don't believe it would, it's basically just doing what you would normally do for default loadouts in the init.sqf, just that it's only applying it to certain players based on their humanity.

 

Thanks for the tip on DefaultBackpackWeapon, I probably should add that in.

Share this post


Link to post
Share on other sites
  • 0

I don't believe it would, it's basically just doing what you would normally do for default loadouts in the init.sqf, just that it's only applying it to certain players based on their humanity.

 

Thanks for the tip on DefaultBackpackWeapon, I probably should add that in.

Oh ok cool :) Sorry i couldnt help more :(

Share this post


Link to post
Share on other sites
  • 0

I've made some adjustments for testing, the following code is also not working:

Execution line in init.sqf is now:

null = [] execVM "scripts\loadout.sqf";

Loadout.sqf is now the following:
 

// HERO LOADOUT GRANTER
Private ["_humanity"];

waitUntil {!isNull player}; // Make sure player object exists
waitUntil {(getPlayerUID player) != ""}; // Check that player is actually a player
_humanity = (player getVariable["humanity",0]);

if((_humanity) >= 20000) then {
diag_log "GRANTING HERO LOADOUT TO PLAYER";
//Overridden inventory here
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller"];
DefaultWeapons = ["glock17_EP1","ItemMap"];
DefaultBackpack = "DZ_British_ACU";
}; // END HERO LOADOUT GRANTER

Share this post


Link to post
Share on other sites
  • 0

Hello,

 

 I really would like to get this figured out for my server as well. Problem we are having is Bandits spawn in with survivor clothes and it creates a multitude of issues...

 

I found this thread... http://opendayz.net/threads/humanity-based-loadouts.10447/ and it looks like it might work but only problem is, my server_playerLogin.sqf looks different.

 

The one from the above thread...

    if (true) then {
        _key = format["CHILD:999:select replace(`inventory`, '""', '\'') `inventory`, replace(`backpack`, '""', '\'') `backpack` from `instance` where `id` = ?:[%1]:",dayZ_instance];
        _data = "HiveEXT" callExtension _key;
        //Process result
        _result = call compile format ["%1", _data];
        _status = _result select 0;
        if (_status == "CustomStreamStart") then {
            if ((_result select 1) > 0) then {
                _data = "HiveEXT" callExtension _key;
                _result = call compile _data;
                _inventory = call compile (_result select 0);
                _backpack = call compile (_result select 1);
            };
        };
    };

//PLACE NEW CODE HERE

    if (true) then {
        _key = format["CHILD:999:select replace(cl.`inventory`, '""', '\'') inventory, replace(cl.`backpack`, '""', '\'') backpack, replace(coalesce(cl.`model`, 'Survivor2_DZ'), '""', '\'') model from `cust_loadout` cl join `cust_loadout_profile` clp on clp.`cust_loadout_id` = cl.`id` where clp.`unique_id` = '?':[%1]:",str(_playerID)];
        _data = "HiveEXT" callExtension _key;
        //Process result
        _result = call compile format ["%1", _data];
        _status = _result select 0;
        if (_status == "CustomStreamStart") then {
            if ((_result select 1) > 0) then {
                _data = "HiveEXT" callExtension _key;
                _result = call compile format ["%1", _data];
                _inventory = call compile (_result select 0);
                _backpack = call compile (_result select 1);
                _model = call compile (_result select 2);
            };
        };
    };

 and mine looks like...

private ["_isInfected","_doLoop","_hiveVer","_isHiveOk","_playerID","_playerObj","_primary","_key","_charID","_playerName","_backpack","_isNew","_inventory","_survival","_model","_mags","_wpns","_bcpk","_config","_newPlayer"];

#ifdef DZE_SERVER_DEBUG
diag_log ("STARTING LOGIN: " + str(_this));
#endif

_playerID = _this select 0;
_playerObj = _this select 1;
_playerName = name _playerObj;

if (_playerName == '__SERVER__' || _playerID == '' || local player) exitWith {};

if (isNil "sm_done") exitWith { 
#ifdef DZE_SERVER_DEBUG
	diag_log ("Login cancelled, server is not ready. " + str(_playerObj)); 
#endif
};

if (count _this > 2) then {
	dayz_players = dayz_players - [_this select 2];
};

//Variables
_inventory =	[];
_backpack = 	[];
_survival =		[0,0,0];
_isInfected =   0;
_model =		"";

if (_playerID == "") then {
	_playerID = getPlayerUID _playerObj;
};

if ((_playerID == "") or (isNil "_playerID")) exitWith {
#ifdef DZE_SERVER_DEBUG
	diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID");
#endif
};

#ifdef DZE_SERVER_DEBUG
diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
#endif

//Do Connection Attempt
_doLoop = 0;
while {_doLoop < 5} do {
	_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
	_primary = _key call server_hiveReadWrite;
	if (count _primary > 0) then {
		if ((_primary select 0) != "ERROR") then {
			_doLoop = 9;
		};
	};
	_doLoop = _doLoop + 1;
};

if (isNull _playerObj or !isPlayer _playerObj) exitWith {
#ifdef DZE_SERVER_DEBUG
	diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj));
#endif
};

if ((_primary select 0) == "ERROR") exitWith {
#ifdef DZE_SERVER_DEBUG
    diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID];
#endif
};

//Process request
_newPlayer = 	_primary select 1;
_isNew = 		count _primary < 7; //_result select 1;
_charID = 		_primary select 2;

#ifdef DZE_SERVER_DEBUG
diag_log ("LOGIN RESULT: " + str(_primary));
#endif

/* PROCESS */
_hiveVer = 0;

if (!_isNew) then {
	//RETURNING CHARACTER		
	_inventory = 	_primary select 4;
	_backpack = 	_primary select 5;
	_survival =		_primary select 6;
	_model =		_primary select 7;
	_hiveVer =		_primary select 8;
	
	if (!(_model in AllPlayers)) then {
		_model = "Survivor2_DZ";
	};
	
} else {
	if (DZE_PlayerZed) then {
		_isInfected = _primary select 3;
	} else {
		_isInfected = 0;
	};
	_model =		_primary select 4;
	_hiveVer =		_primary select 5;
	
	if (isNil "_model") then {
		_model = "Survivor2_DZ";
	} else {
		if (_model == "") then {
			_model = "Survivor2_DZ";
		};
	};

	
	//Record initial inventory only if not player zombie 
	if(_isInfected != 1) then {
		_config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default");
		_mags = getArray (_config >> "magazines");
		_wpns = getArray (_config >> "weapons");
		_bcpk = getText (_config >> "backpack");

		if(!isNil "DefaultMagazines") then {
			_mags = DefaultMagazines;
		};
		if(!isNil "DefaultWeapons") then {
			_wpns = DefaultWeapons;
		};
		if(!isNil "DefaultBackpack") then {
			_bcpk = DefaultBackpack;
		};
		//_randomSpot = true;
	
		//Wait for HIVE to be free
		_key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
		_key call server_hiveWrite;
	};
};

#ifdef DZE_SERVER_DEBUG
diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj) + " at location: " + (getPosATL _playerObj));
#endif

_isHiveOk = false;
if (_hiveVer >= dayz_hiveVersionNo) then {
	_isHiveOk = true;
};

if (worldName == "chernarus") then {
	([4654,9595,0] nearestObject 145259) setDamage 1;
	([4654,9595,0] nearestObject 145260) setDamage 1;
};

dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer,_isInfected];
(owner _playerObj) publicVariableClient "dayzPlayerLogin";

I am also on a dayz,st server. Maybe the file changed with Epoch Updates? Idk,

 

Anyone know how to set up custom loadouts based on humanity?

 

Thanks,

 

Zero

Share this post


Link to post
Share on other sites
  • 0

I think I could do this; at work atm, will do it when I go home okay? 

 

~Mochan

Mochan, that would be great! Thank You!

 

This is actually a very interessting idea. Keep me up to date about this, please!

I absolutely will! If we come up with a solution I will post it here!

 

@ZeroK00L

that cant work because of the hive child 999 and 998 they are not supported in epoch

Ah I see, too bad! Thanks for the info!

 

Zero

Share this post


Link to post
Share on other sites
  • 0

im unsure why you would want to use hive calls for this, it could be quite easy done with a few lines of code in the init

 

I'm not trying to use Hive Calls, to be honest Id rather not. That's why I am asking for help. If its so easy, would you mind sharing?

 

Zero

Share this post


Link to post
Share on other sites
  • 0

I'm not trying to use Hive Calls, to be honest Id rather not. That's why I am asking for help. If its so easy, would you mind sharing?

 

Zero

 

idk what you want me to share, as this is common knowlage ... you can use these lines to determin if the player is freshspawned or not:

waitUntil {!isNil ("PVDZE_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then {

then add some code below to switch skin of the player if he has a certain amount of humanity

Share this post


Link to post
Share on other sites
  • 0

idk what you want me to share, as this is common knowlage ... you can use these lines to determin if the player is freshspawned or not:

waitUntil {!isNil ("PVDZE_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then {

then add some code below to switch skin of the player if he has a certain amount of humanity

 

If this is common knowledge why are there so many threads of people trying to get help with custom load outs? Just forget it. If you are not willing to contribute to this community a working script or some snippet that will help lead into the right direction and are just going to post elitist statements and be a dick then I don't want your help. When I get this figured out I will post a TuT for anyone wanting it.

Share this post


Link to post
Share on other sites
  • 0

If this is common knowledge why are there so many threads of people trying to get help with custom load outs? Just forget it. If you are not willing to contribute to this community a working script or some snippet that will help lead into the right direction and are just going to post elitist statements and be a dick then I don't want your help. When I get this figured out I will post a TuT for anyone wanting it.

 

omg, are you serius?

 

if you are, you are obviusly an idiot ...

 

i just told you how you can do this, its not that hard.

just add a few lines underneth what i wrote to determin what humanity the player has and hand out skins or gear acordingly ...

 

or do you expect me to write the script for you aswell??

 

you are terribly wrong if you are, i could really care less about this ...

if i really wanted this, it im sure i could code it before i go to lunch, as it is quite the simple task.

(infact i already did something like this, as i created the spawn selection i use on my servers)

 

if you are so lost and frustrated that you feel you need to attack whoever is trying to help, then i guess it must be really hard for you, and i do feel sorry for you then.

 

either way ill point you in the direction (again, even tho this is also common knowledge aswell) ...

 

but try chekout "player_humanityMorph".

 

 

edit:

oh and btw, custom loadout is a lot easier as the epoch guys already prepared for that:

DefaultMagazines = [];
DefaultWeapons = [];
DefaultBackpack = "";

Share this post


Link to post
Share on other sites
  • 0

idk what you want me to share, as this is common knowlage ... you can use these lines to determin if the player is freshspawned or not:

waitUntil {!isNil ("PVDZE_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then {

then add some code below to switch skin of the player if he has a certain amount of humanity

 

 

Hey thanks for this post, I appreciate you taking the time. I know that what I'm trying to accomplish is probably super simple, I just started Arma scripting a few weeks ago so I'm still getting the hang of it. That's why what I came up with is noob-level to the max. I'm assuming there are no issues with what I posted here:

 

 

// HERO LOADOUT GRANTER
Private ["_humanity"];
_humanity = player getVariable["humanity",0];

diag_log "GRANTING HERO LOADOUT TO PLAYER";
if(_humanity >= 20000) then {
//Overridden inventory here
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller"];
DefaultWeapons = ["glock17_EP1","ItemMap"];
DefaultBackpack = "DZ_British_ACU";
}; // END HERO LOADOUT GRANTER

 

Am I correct? If so I think I could probably just take everything from the if statement down and drop it under the code you've provided. I'll give this a shot and report back. Thanks again.

Share this post


Link to post
Share on other sites
  • 0

Hey thanks for this post, I appreciate you taking the time. I know that what I'm trying to accomplish is probably super simple, I just started Arma scripting a few weeks ago so I'm still getting the hang of it. That's why what I came up with is noob-level to the max. I'm assuming there are no issues with what I posted here:

 

 

// HERO LOADOUT GRANTER
Private ["_humanity"];
_humanity = player getVariable["humanity",0];

diag_log "GRANTING HERO LOADOUT TO PLAYER";
if(_humanity >= 20000) then {
//Overridden inventory here
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller"];
DefaultWeapons = ["glock17_EP1","ItemMap"];
DefaultBackpack = "DZ_British_ACU";
}; // END HERO LOADOUT GRANTER

 

Am I correct? If so I think I could probably just take everything from the if statement down and drop it under the code you've provided. I'll give this a shot and report back. Thanks again.

 

looks about right ... if you dont know, then for this to work, you will need to edit server_playerSetup.sqf aswell ... find this:

dayzPlayerLogin2 = [_worldspace,_state];

change it to this:

dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];

and you should be good ...

Share this post


Link to post
Share on other sites
  • 0

looks about right ... if you dont know, then for this to work, you will need to edit server_playerSetup.sqf aswell ... find this:

dayzPlayerLogin2 = [_worldspace,_state];

change it to this:

dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];

and you should be good ...

 

Ok great, thanks for the tip. I didn't know that. What am I accomplishing by making this change?

 

 

Edit:

I've made the required changes, including the change to the playerSetup sqf in the server pbo. Loadouts still are not working, here's what my script looks like now:

 

// HERO LOADOUT GRANTER
Private ["_humanity"];

waitUntil {!isNil ("PVDZE_plr_LoginRecord")};

_humanity = (player getVariable["humanity",0]);
if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then {
if(_humanity >= 20000) then {
diag_log ("GRANTING HERO LOADOUT TO PLAYER");
//Overridden inventory here
DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller"];
DefaultWeapons = ["glock17_EP1","ItemMap"];
DefaultBackpack = "DZ_British_ACU";
DefaultBackpackWeapon = "";
};
}; // END HERO LOADOUT GRANTER

Share this post


Link to post
Share on other sites
  • 0

I *think* I know what is happening here. So you have   null = [] execVM "scripts\loadout.sqf";   in your init.sqf, above the player monitor, which is where a loadout script based on UID should be located because it sets the default loadout AFTER the server has determined the players UID (line 7 or 31 in server_playerLogin.sqf), and before the server has checked if there is default loadout defined (line 118-126 in server_playerLogin.sqf). The problem with trying to base the loadout on humanity in this way is that the server doesn't check or apply a players humanity before defining the default loadout (in server_playerLogin.sqf). So whats happening is that your script is checking the humanity of the player before the server has even bothered to pull it from the database and apply it to the player, so doing it in this way, the player will always show as 0 (or null) humanity when your script is called and since your DefaultMagazines, ect, is only applied IF humanity is greater than 20000, it will never been seen by the server when setting up the player. 

 

One *possible* way to get this to work (loadout based on humanity) is by not defining a default loadout (DefaultMagazines, ect), but by adding the items directly to the player when they login...you've actually already got the 'wait til player has respawned' line in your script:  if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then    instead of defining your default loadout here (because the server has already done that) you could instead add the items directly to the player, mabye something like:  player addMagazine 'ItemBandage';  and  player addWeapon 'ItemMap';   and all the other stuff you want that player to have.

 

This *might* work. I'm not at home and can't test it right now, but I'm fairly sure that is why your script isn't working. Good luck!

Share this post


Link to post
Share on other sites
  • 0

I *think* I know what is happening here. So you have   null = [] execVM "scripts\loadout.sqf";   in your init.sqf, above the player monitor, which is where a loadout script based on UID should be located because it sets the default loadout AFTER the server has determined the players UID (line 7 or 31 in server_playerLogin.sqf), and before the server has checked if there is default loadout defined (line 118-126 in server_playerLogin.sqf). The problem with trying to base the loadout on humanity in this way is that the server doesn't check or apply a players humanity before defining the default loadout (in server_playerLogin.sqf). So whats happening is that your script is checking the humanity of the player before the server has even bothered to pull it from the database and apply it to the player, so doing it in this way, the player will always show as 0 (or null) humanity when your script is called and since your DefaultMagazines, ect, is only applied IF humanity is greater than 20000, it will never been seen by the server when setting up the player. 

 

One *possible* way to get this to work (loadout based on humanity) is by not defining a default loadout (DefaultMagazines, ect), but by adding the items directly to the player when they login...you've actually already got the 'wait til player has respawned' line in your script:  if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then    instead of defining your default loadout here (because the server has already done that) you could instead add the items directly to the player, mabye something like:  player addMagazine 'ItemBandage';  and  player addWeapon 'ItemMap';   and all the other stuff you want that player to have.

 

This *might* work. I'm not at home and can't test it right now, but I'm fairly sure that is why your script isn't working. Good luck!

 

This does make alot of sense! Thanks for the tip! Our server hosted through Dyaz.St sets up the default loadout in the init.sqf though? Does that make a difference on what you said? I've tried everything else so gonna try this tonight. Thanks again!

Share this post


Link to post
Share on other sites
  • 0

Finally got it! Thanks to THAC0_Gewch for kicking off this thread! Hope this works for you too bro! Special thanks to Halvhjearne for his tough love ;) lol and Extra Special Thanks to ritualmsry for pointing out that last little thing I was missing! I am no pro scripter by far and have tested this thoroughly so please forgive me if I made any mistakes and please feel free to clean it up or modify/improve! It actually is quite easy when you have the right info and kind people willing to help! I've learned so much from this little trial and my server is finally perfect! Running 20+ Scripts now very cleanly. Thanks for your help guys, couldn't have got this without you!

 

In your init.sqf add under if (!isDedicated) then {              (This may vary on your setup)

[] execVM "Loadouts\heroloadout.sqf";
[] execVM "Loadouts\banditloadout.sqf";

heroloadout.sqf

// Hells Cowboys Hero Loadout
Private ["_humanity"];

waitUntil {!isNil ("PVDZE_plr_LoginRecord")};

_humanity = (player getVariable["humanity",0]);
if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then {
if(_humanity >= 5000) then {
removeAllWeapons player;
removeAllItems player;
removeBackpack player;
player addMagazine '30Rnd_556x45_Stanag';
player addMagazine '30Rnd_556x45_Stanag';
player addMagazine '30Rnd_556x45_Stanag';
player addMagazine '30Rnd_556x45_Stanag';
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';
player addMagazine 'ItemMorphine';
player addMagazine 'ItemAntibiotic';
player addMagazine 'ItemPainkiller';
player addMagazine 'ItemSodaLemonade';
player addMagazine 'FoodbaconCooked';
player addMagazine '7Rnd_45ACP_1911';
player addMagazine '7Rnd_45ACP_1911';
player addMagazine '7Rnd_45ACP_1911';
player addMagazine '7Rnd_45ACP_1911';
player addMagazine 'ItemGoldBar10oz';
player addMagazine 'Skin_Soldier_Sniper_PMC_DZ';
player addWeapon 'M4A1_Aim';
player addWeapon 'Colt1911';
player addWeapon 'ItemCrowbar';
player addWeapon 'ItemToolbox';
player addWeapon 'ItemEtool';
player addWeapon 'ItemGPS';
player addWeapon 'ItemMap';
player addWeapon 'ItemKnife';
player addWeapon 'MeleeHatchet_DZE';
player addWeapon 'ItemCompass';
player addWeapon 'ItemMatchbox';
player addBackpack 'DZ_British_ACU';
};
};

banditloadout.sqf

// Hells Cowboys Bandit Loadout
Private ["_humanity"];

waitUntil {!isNil ("PVDZE_plr_LoginRecord")};

_humanity = (player getVariable["humanity",0]);
if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then {
if(_humanity <= -5000) then {
removeAllWeapons player;
removeAllItems player;
removeBackpack player;
player addMagazine '30Rnd_545x39_AK';
player addMagazine '30Rnd_545x39_AK';
player addMagazine '30Rnd_545x39_AK';
player addMagazine '30Rnd_545x39_AK';
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';
player addMagazine 'ItemMorphine';
player addMagazine 'ItemAntibiotic';
player addMagazine 'ItemPainkiller';
player addMagazine 'ItemSodaRabbit';
player addMagazine 'FoodCanDemon';
player addMagazine '15Rnd_9x19_M9';
player addMagazine '15Rnd_9x19_M9';
player addMagazine '15Rnd_9x19_M9';
player addMagazine '15Rnd_9x19_M9';
player addMagazine 'ItemGoldBar10oz';
player addMagazine 'Skin_GUE_Commander_DZ';
player addWeapon 'AKS_74_kobra';
player addWeapon 'UZI_EP1';
player addWeapon 'ItemCrowbar';
player addWeapon 'ItemToolbox';
player addWeapon 'ItemEtool';
player addWeapon 'ItemGPS';
player addWeapon 'ItemMap';
player addWeapon 'ItemKnife';
player addWeapon 'MeleeHatchet_DZE';
player addWeapon 'ItemCompass';
player addWeapon 'ItemMatchbox';
player addBackpack 'DZ_Backpack_EP1';
};
};

Obvisiouly you can change the items spawned to whatever you want :) Have fun!

 

Zero

 

Edit: Forget to mention two minor weird things. 1.) When first spawning, player needs to switch to Pistol then back to Rifle for rifle to load ammo. Not sure why it doesn't spawn ready to load ammo. Tried the command reloadplayer; but that didn't help. 2.) The skin ends up in inventory not on player. I tried removing the Skin_ portion off of the skin and got a config error. Go figure. Let me know if you guys get around this. :)

Share this post


Link to post
Share on other sites
  • 0

Ah, ok, thanks!

waitUntil {!isNil ("PVDZE_plr_LoginRecord")};

Does that piece of code prevent losing "inventory" on regulars?

 

That makes sure the player has logged in...

 

This one...

if (dayzPlayerLogin2 select 2 and !(player isKindOf "PZombie_VB")) then {

... makes sure the player is a new spawn. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By mudzereli
      Outdated, does not work with Epoch 1.0.7
      DEPLOYABLE BIKE 2.8.2
      all of this information is available in an easier-to-read format on github pages>>
      version 2.8.2 updates the code to work with Epoch Mod 1.0.6. Thanks @ebaydayz!
      version 2.8.1 should hopefully fix the long-standing non-moving-bike problem! Thanks @SchwEde!
      FYI: 2.8.0 adds the _condition and _ammo parameters to the config array so you will need to add a value for these parameter in each record of the DZE_DEPLOYABLES_CONFIG array in the appropriate spot if you are upgrading from 2.6
       
      Out of the box, it adds a deployable bike with a right click action on a toolbox and a couple other neat deployables.
      Really, it can be used to deploy just about anything. See the configuration section below.
      For some samples of what it can do, check out this gallery on imgur
       
      Installation
      download the files extract the addons and overwrites folder from the downloaded zip file into your mission file root find this line in your mission file init.sqf (warning: if you have a custom compiles file, find that line instead of the one below!) call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; place this line directly after the line you found call compile preprocessFileLineNumbers "addons\bike\init.sqf"; edit addons\bike\config.sqf to change some options or add different deployables (see configuration section for more info) Warning:
      due to the way the way arma handles numbers and the way addon is coded, using the save-to-database option may not allow you to re-pack some objects if you have Character ID's over 500,000 (which I don't think will be an issue for 99.99% of people).  
      Adding Your Own Custom Actions
      If you use another right click method like extra_rc.hpp and want to switch to my method, see my click actions configuration github page.
      The click actions script is included in the deploy script as part of the core, so you don't need to download anything, just follow the instructions for adding your own actions.
      * note: before attempting to troubleshoot issues with adding your own actions, make sure you are using the most recent version of the addon.
       
      Configuration
      This addon is highly configurable, you can deploy just about anything, not just bikes.
      open addons\bike\config.sqf and edit the array to add your own deployables.
       
      DZE_DEPLOYABLES_CONFIG format -- (note no comma after last array entry)
      DZE_DEPLOYABLES_CONFIG = [ [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_hive,_plot,_simulation,_deployables,_near,_parts], [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_hive,_plot,_simulation,_deployables,_near,_parts], [...more stuff here...] ]; DZE_DEPLOYABLES_CONFIG array values (view on github to read easier):
      parameter | description | type | example --------------|---------------------------------------------------------------------|--------|-------- _clickItem | class name of the item to click on | string | "ItemToolbox" _deployOffset | [_side,_front,_up] array to offset the deployable when buiding | array | [0,2,1] _packDistance | how close does the packer need to be to pack the object? | number | 5 _damageLimit | item can't be repacked if damage is > this. (-1 = no re-packing) | number | 0.1 _packAny | can anyone repack the deployable? | bool | false _cargo | clear the cargo of the deployable? | bool | false _ammo | should vehicle ammo be cleared? (does not persist through restart) | bool | true _hive | write deployable to database? | bool | false _plot | require a plot from the owner to build the deployable? | bool | false _simulation | enable simulation (movement/damage) for the object? (true for cars) | bool | true _road | enable road building for this object? | bool | true _deployables | array of class names that can be deployed with this method | array | ["MMT_Civ"] _near | array of items required nearby to build (workshop/fire/fueltank) | array | [] _parts | array of parts required to build (will be taken from player) | array | ["ItemToolbox"] _condition | string of code to evaluate to determine whether action is shown | string | "!(isNull player) && {(getPlayerUID player) in DZE_DEPLOYABLE_ADMINS}" DZE_DEPLOYABLE_NAME_MAP array -- allows you to rename the deployable (on the right click/messages)
      format (note no comma after last array entry)
      DZE_DEPLOYABLE_NAME_MAP = [ [_class,_name], [_class,_name], [... more ...] ];  array parameters
      parameter    | description                                                         |  type  | example --------------|---------------------------------------------------------------------|--------|-------- _class        | class name of the item you want to replace the name of              | string | "Notebook" _name         | new name to display when right clicking                             | string | "Macbook Pro" Change Log
      version | change --------|------- 2.8.2 | updates for 1.0.6! Thanks @ebaydayz! 2.8.1 | fix from SchwEde that should fix bike not moving. Thanks @SchwEde! 2.8.0 | option to clear vehicle ammo 2.7.1 | better exit reasons 2.7.0 | option to add condition for showing action in config 2.6.1 | fix for unrideable bikes 2.6.0 | road building options, deployable name mapping 2.5.1  | fix a bug where preview items would sometimes disappear  2.5.0  | now uses a modified epoch building system to deploy the objects  2.4.3  | better click actions build conflict detection  2.4.2  | updated for new click actions handler build  2.4.1  | fixed deployables spawning in locked after restart  2.4.0  | multi-part deployables. yay!  2.3.1  | big fix on packing temp objects  2.3.0  | optional saving to database with post-restart memory of deployed items (see warning below about this) | configurable damage limits on re-packing | admin list for packing/deploying instantly & being able to remove all deployables  2.2.1  | positioning fix for deployed items  2.2.0  | option for clearing cargo of spawned items  2.1.0  | change way dependency call is made, only one line needed in init.sqf now for setup  2.0.0  | major update, allow multiple deployables, pretty much any class  1.1.0  | configuration options / code optimization  1.0.0  | release Issues/FAQ
      1) people are getting kicked for createvehicle restriction when building a stone wall
      open your battleye filter createvehicle.txt and change this line
      5 "Fort_" !="Fort_RazorWire" !="Fort_RazorWirePreview" to this:
      5 "Fort_" !="Fort_RazorWire" !="Fort_RazorWirePreview" != "Fort_StoneWall_EP1" 2) I am using "A Plot For Life" and this is not working!
    • By salival
      Hi,
      Here's my version of  @OtterNas3 vehicle key changer.  It was subsequently modified by @Grahame for epoch 1.0.6. Updated for 1.0.7.
      This adds support for briefcases, gems and coins as well as using the epoch vehicle upgrade system to do the key changing/claiming.
      * original discussion url: https://epochmod.com/forum/topic/5972-release-vehicle-key-changer-for-making-masterkey-v-14-updated-06152014/
      * updated discussion url: https://epochmod.com/forum/topic/43048-release-vehicle-key-changer-for-making-masterkey-v-141-updated-for-epoch-106/
      Github link with install directions: https://github.com/oiad/vkc
      **EDIT* Link to a working locate Vehicle script that is able to find multiple vehicles per key: 
       
      **** For Epoch 1.0.6.2 only **** >> Download <<
      Visit this link: https://github.com/oiad/vkc/tree/vkc-Epoch-1.0.6.2
    • By salival
      Hi guys,
      Here's my version of the bury/butcher body script. Focus'd on optimization and cleanliness.
      * Tested as working on a blank Epoch 1.0.7 server
      * Contains a server side scheduler module to clean up old weapon crates, graves and crosses after 25 minutes.
      * Removes the flies sound when body is buried for performance.
       
      To download: https://github.com/oiad/buryBodies
       
      **** For Epoch 1.0.6.2 only **** >> Download <<
      Visit this link: https://github.com/oiad/buryBodies/tree/Epoch_1.0.6.2
    • By salival
      Hi,
      Since Zabn is MIA I have updated his Take Clothes script to 1.0.7 compatible.
      Github with install instructions and download location: https://github.com/oiad/TakeClothes
       
       
      **** For Epoch 1.0.6.2 only **** >> Download <<
      Visit this link: https://github.com/oiad/TakeClothes/tree/Epoch_1.0.6.2
      (original install url: http://opendayz.net/threads/release-zabns-take-clothes-2-0.19290/)
      (original discussion url: http://opendayz.net/threads/help-discussion-zabns-take-clothes.13198/)
       
    • By salival
      Hi,
      With Axe Cops permission I am releasing my updated version of his amazing Service Points script. 
      This includes support for original briefcases, gems (from epoch 1.0.7) and coins.
          (original github url: https://github.com/vos/dayz/tree/master/service_point)
          (original install/discussion url: https://epochmod.com/forum/topic/3935-release-vehicle-service-point-refuel-repair-rearm-script/)
          
      **** *REQUIRES DAYZ EPOCH 1.0.7* ****
          
      Major Changes:
          This version adds support for both single currency and gems (from the epoch 1.0.6 update) as well as the original epoch briefcase currency system. 
          Instead of pricing things like the original way, prices are now done on a "worth" similar to how coins are done. The price value of items are below.
          If you are using coins, I would recommend using the _currencyModifier variable since coins typically are 10x the value of briefcase based currency (1 brief == 100,000 coins)
          (You can either set this _currencyModifier variable to 1 then set the proper value or use the modifier, the modifier is mainly for dual currency servers)
          1 silver = 1 worth
          1 10oz silver = 10 worth
          1 gold = 100 worth
          1 10oz gold = 1,000 worth
          1 briefcase = 10,000 worth
          Please see dayz_code\configVariables.sqf for the value of gems (DZE_GemWorthArray) and their relevant worth if they are enabled.
          Example config settings for _refuel_costs, _repair_costs and _rearm_costs:
          All 3 sections can either be made free, disabled or a specifc price with the following examples:
          ["Air","free"] will make the vehicle config class of "Air" free for the specific action.
          ["Air","disabled"] will make the vehicle config class of "Air" disabled for the specific action.
          ["Air",2000] will make the vehicle config class of "Air" have a worth of 2000 for the specific action.
          ["Armored_SUV_PMC",2000] will make the specific vehicle have a worth of 2000 for the specific action.
          ["Armored_SUV_PMC","free"] will make the specific vehicle be free for the specific action.
          ["Armored_SUV_PMC","disabled"] will make the specific vehicle be disabled for the specific action.
          Valid vehicle config classes as an example: "Air", "AllVehicles", "All", "APC", "Bicycle", "Car", "Helicopter", "Land", "Motorcycle", "Plane", "Ship", "Tank"
      Visit my Github page to download and read the README.MD : https://github.com/oiad/service_points
      Old Epoch 1.0.6.2 Version can be found here: https://github.com/oiad/service_points/archive/refs/tags/Epoch_1.0.6.2.zip
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...