Jump to content

starter pack


Ghostman

Recommended Posts

You can add start money for new players by changing some code in server_playerLogin.sqf.

Spoiler

 

In dayz_server\compile\server_playerLogin.sqf find:


PVCDZ_plr_Login = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer,_isInfected,_group,_CharacterCoins,_playerCoins,_BankCoins];

If you want to give the player (so coins are on the body) 5k coins, add this line before it:


if (_newPlayer) then {_characterCoins = 5000};

If you want to give the player 5k coins into their bank, add this line instead:


if (_newPlayer) then {_bankCoins = 5000};

 

Source: @salival's ZSC instructions: https://github.com/oiad/ZSC
Link to comment
Share on other sites

@Ghostman

 

1-open your  server_playersetup.spf

find this line:

PVCDZ_plr_Login2 = [_worldspace,_state];

replace by:

PVCDZ_plr_Login2 = [_worldspace,_state,_randomSpot];

save, and repack your pbo.

2-At bottom of init.sqf paste:

startkit = compile preprocessFileLineNumbers "startkit.sqf";
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (PVCDZ_plr_Login2 select 2) then
{
    player spawn startkit;
};

3-create startkit.sqf (mpmissions\your instance\ )

startkit.sqf

Spoiler

private ["enter all variables here please"];

systemchat "this is a gift for new players";

sleep 1;

_mypos = getposATL player;
_dir = getdir player;
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)];
_crate  = createVehicle ["USOrdnanceBox_EP1",_mypos,[], 0, "CAN_COLLIDE"];
_crate setDir _dir;
_crate setposATL _mypos;

clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

//////FILL THE CRATE

//weapons && tools below

_crate addWeaponCargoGlobal ["ItemToolbox", 2];
 _crate addWeaponCargoGlobal ["ItemEtool", 2];
  _crate addWeaponCargoGlobal ["ItemCompass", 2];
 _crate addWeaponCargoGlobal ["Binocular", 2];

    
    // items below
  
  _crate addMagazineCargoGlobal ["metal_floor_kit", 20];
    _crate addMagazineCargoGlobal ["FoodCanSardines", 10];
    _crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
    
 waitUntil {(player distance _crate) > 20};
deleteVehicle _crate;  

 

   

 

Link to comment
Share on other sites

On 11.06.2017 at 7:31 PM, juandayz said:

@Ghostman

 

1-open your  server_playersetup.spf

find this line:


PVCDZ_plr_Login2 = [_worldspace,_state];

replace by:


PVCDZ_plr_Login2 = [_worldspace,_state,_randomSpot];

save, and repack your pbo.

2-At bottom of init.sqf paste:


startkit = compile preprocessFileLineNumbers "startkit.sqf";
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (PVCDZ_plr_Login2 select 2) then
{
    player spawn startkit;
};

3-create startkit.sqf (mpmissions\your instance\ )

startkit.sqf

  Reveal hidden contents

private ["enter all variables here please"];

systemchat "this is a gift for new players";

sleep 1;

_mypos = getposATL player;
_dir = getdir player;
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)];
_crate  = createVehicle ["USOrdnanceBox_EP1",_mypos,[], 0, "CAN_COLLIDE"];
_crate setDir _dir;
_crate setposATL _mypos;

clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

//////FILL THE CRATE

//weapons && tools below

_crate addWeaponCargoGlobal ["ItemToolbox", 2];
 _crate addWeaponCargoGlobal ["ItemEtool", 2];
  _crate addWeaponCargoGlobal ["ItemCompass", 2];
 _crate addWeaponCargoGlobal ["Binocular", 2];

    
    // items below
  
  _crate addMagazineCargoGlobal ["metal_floor_kit", 20];
    _crate addMagazineCargoGlobal ["FoodCanSardines", 10];
    _crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
    
 waitUntil {(player distance _crate) > 20};
deleteVehicle _crate;  

 

   

 

I'm sorry for the late reply but unfortunately this script does not work

Link to comment
Share on other sites

Just now, Ghostman said:

in server_playersetup.spf

PVCDZ_plr_Login2 = [[0,respawn_west_original],_state,_worldspace,_randomSpot,([_randomSpot,_playerID] call spawn_config)];

and sarver can't run 119 sec server to start .....

well now i see youre using ESSV3... this change the things

Link to comment
Share on other sites

Just now, Ghostman said:

yes i am using essv3, but your script spawn box only for new players on scroll mouse or near player when they spawn on ground?

for fresh spawns.. they die.. they have a crate.  If they log out and relog again then dsnt have a crate.

Why you just not use the loadout and config class from ESSV3?

Link to comment
Share on other sites

the one that i give you works, but with out essv3 im using it... but you need change the part in init cuz select 2 is not _randSpot if u use ESsv3

im fixing other thing.. when i fininish gonna install essv3 and give a try with this

Link to comment
Share on other sites

Just now, Ghostman said:

no problem and thx for your help

ok my friend this is what i wrote for you.. i made some tests and works fine. If u see that meet your expectations please post in arma2/mod forums for everyone.

**Note: its only for user of ESSV3

1-You will need open your init.sqf  and at very very very bottom paste:

waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (PVCDZ_plr_Login2 select 3) then
{

_text = "Claim My Box";
s_player_box = player addAction [format["%1",_text], "scripts\player_startkit.sqf"];	
};

2- into mpmissions\the instance that youre using\scripts\    create this file:

player_startkit.sqf  (customize the options and the loot at your taste)

Spoiler

private ["_mypos","_dir","_crate","_inVehicle","_flypos","_msg","_lootOption","_loot_lists","_loot"];


_inVehicle = (vehicle player != player);
if (_inVehicle) exitWith {systemchat "<PREVENTION>:Cannot Do it in vehicles";};
_flypos = ((getPosATL (vehicle player)) select 2);

if (_flypos > 3) exitWith {systemchat "<PREVENTION>:you must be in the ground";}; //Prevention for HALO SPAWNS since i notice that youre runnig ESSV3


player removeAction s_player_box;
s_player_box -1;



//=========USER CONFIG============\\
_lootOption = 1; //1 randomize loot //0 allways same loot
_msg = 0; //0 uses hint //1 uses systemchat
_crateType = "USOrdnanceBox_EP1";
//=========USER CONFIG============\\



if (_msg != 1) then {hint "<SERVER>:GIFT FOR FRESH SPAWNS";}else{systemchat ">SERVER<: GIFT FOR FRESH SPAWNS";};

_mypos = getposATL player;
_dir = getdir player;
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)];
_crate  = createVehicle [_crateType,_mypos,[], 0, "CAN_COLLIDE"];
_crate setDir _dir;
_crate setposATL _mypos;

clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

//////FILL THE CRATE


if (_lootOption !=1) then {
  //=============================IF URE USING _lootOption = 0; customize below the loot==========\\
//weapons && tools below
_crate addWeaponCargoGlobal ["ItemToolbox", 2];
_crate addWeaponCargoGlobal ["ItemEtool", 2];
_crate addWeaponCargoGlobal ["ItemCompass", 2];
_crate addWeaponCargoGlobal ["Binocular", 2];

// items below
_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
  //=============================IF URE USING _lootOption = 0; customize above the loot==========\\
}else{
  
  
  //=============================IF URE USING _lootOption = 1; customize below the loot==========\\
_loot_lists = [
[
["ChainSawR","ItemSledge","ItemPickaxe"],
["CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","PartGeneric"]
],
[
["ItemKeyKit"],
["ItemAntibiotic","ItemBandage","equip_herb_box","ItemGoldBar10oz"]
],
[
["ItemHatchet","ItemMachete","ItemPickaxe","ItemSledge"],
["ItemRuby","ItemMixOil","plot_pole_kit"]
],
[
["ChainSaw"],
["ItemDesertTent","ItemGenerator","equip_brick"]
],
[
["MP5_DZ"],
["ItemComboLock","ItemVault","ItemLockBox"]
]
];
               //=============================IF URE USING _lootOption = 1; customize above the loot==========\\
_loot = _loot_lists call BIS_fnc_selectRandom;
{
_crate addWeaponCargoGlobal [_x,1];
} forEach (_loot select 0);
{
_crate addMagazineCargoGlobal [_x,1];
} forEach (_loot select 1);
};    
 waitUntil {(player distance _crate) > 20};
deleteVehicle _crate;   

 

3-open your custom variables.sqf

Spoiler

find:


dayz_resetSelfActions = {

and before the bracket  };   who close this section paste:


s_player_box -1;

example:


//Player self-action handles
dayz_resetSelfActions = {
 //a LOT 
//OF 
//DEFAULT
//ACTIONS

	// Custom below
	s_givemoney_dialog = -1;
	s_bank_dialog = -1;
	s_player_checkWallet = -1;
	s_player_box -1;
};

 

Remember suicide you until test it.. cuz only fresh spawns are allowed to spawns crates.

Link to comment
Share on other sites

well back to the reallity: @Ghostman  2 ways are better than 2.. here you got:

 

Spoiler
Just now, juandayz said:

ok my friend this is what i wrote for you.. i made some tests and works fine. If u see that meet your expectations please post in arma2/mod forums for everyone.

**Note: its only for user of ESSV3

1-You will need open your init.sqf  and at very very very bottom paste:



waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (PVCDZ_plr_Login2 select 3) then
{

_text = "Claim My Box";
s_player_box = player addAction [format["%1",_text], "scripts\player_startkit.sqf"];	
};

2- into mpmissions\the instance that youre using\scripts\    create this file:

player_startkit.sqf  (customize the options and the loot at your taste)

  Reveal hidden contents



private ["_mypos","_dir","_crate","_inVehicle","_flypos","_msg","_lootOption","_loot_lists","_loot"];


_inVehicle = (vehicle player != player);
if (_inVehicle) exitWith {systemchat "<PREVENTION>:Cannot Do it in vehicles";};
_flypos = ((getPosATL (vehicle player)) select 2);

if (_flypos > 3) exitWith {systemchat "<PREVENTION>:you must be in the ground";}; //Prevention for HALO SPAWNS since i notice that youre runnig ESSV3


player removeAction s_player_box;
s_player_box -1;



//=========USER CONFIG============\\
_lootOption = 1; //1 randomize loot //0 allways same loot
_msg = 0; //0 uses hint //1 uses systemchat
_crateType = "USOrdnanceBox_EP1";
//=========USER CONFIG============\\



if (_msg != 1) then {hint "<SERVER>:GIFT FOR FRESH SPAWNS";}else{systemchat ">SERVER<: GIFT FOR FRESH SPAWNS";};

_mypos = getposATL player;
_dir = getdir player;
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)];
_crate  = createVehicle [_crateType,_mypos,[], 0, "CAN_COLLIDE"];
_crate setDir _dir;
_crate setposATL _mypos;

clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

//////FILL THE CRATE


if (_lootOption !=1) then {
  //=============================IF URE USING _lootOption = 0; customize below the loot==========\\
//weapons && tools below
_crate addWeaponCargoGlobal ["ItemToolbox", 2];
_crate addWeaponCargoGlobal ["ItemEtool", 2];
_crate addWeaponCargoGlobal ["ItemCompass", 2];
_crate addWeaponCargoGlobal ["Binocular", 2];

// items below
_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
  //=============================IF URE USING _lootOption = 0; customize above the loot==========\\
}else{
  
  
  //=============================IF URE USING _lootOption = 1; customize below the loot==========\\
_loot_lists = [
[
["ChainSawR","ItemSledge","ItemPickaxe"],
["CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","PartGeneric"]
],
[
["ItemKeyKit"],
["ItemAntibiotic","ItemBandage","equip_herb_box","ItemGoldBar10oz"]
],
[
["ItemHatchet","ItemMachete","ItemPickaxe","ItemSledge"],
["ItemRuby","ItemMixOil","plot_pole_kit"]
],
[
["ChainSaw"],
["ItemDesertTent","ItemGenerator","equip_brick"]
],
[
["MP5_DZ"],
["ItemComboLock","ItemVault","ItemLockBox"]
]
];
               //=============================IF URE USING _lootOption = 1; customize above the loot==========\\
_loot = _loot_lists call BIS_fnc_selectRandom;
{
_crate addWeaponCargoGlobal [_x,1];
} forEach (_loot select 0);
{
_crate addMagazineCargoGlobal [_x,1];
} forEach (_loot select 1);
};    
 waitUntil {(player distance _crate) > 20};
deleteVehicle _crate;   

 

3-open your custom variables.sqf

  Reveal hidden contents

find:




dayz_resetSelfActions = {

and before the bracket  };   who close this section paste:




s_player_box -1;

example:




//Player self-action handles
dayz_resetSelfActions = {
 //a LOT 
//OF 
//DEFAULT
//ACTIONS

	// Custom below
	s_givemoney_dialog = -1;
	s_bank_dialog = -1;
	s_player_checkWallet = -1;
	s_player_box -1;
};

 

Remember suicide you until test it.. cuz only fresh spawns are allowed to spawns crates.

 

 

Spoiler
Just now, oldmatechoc said:

@juandayz hahahahahah i just made the same thing!

heres mine

https://puu.sh/wjs7d/3532f145ef.rar

Install.

in your init.sqf

// Find



    execFSM "\z\addons\dayz_code\system\player_monitor.fsm";

// Paste below



    [] execVM "dayz_code\external\starter_crate\new_player.sqf";

 

 

 

Link to comment
Share on other sites

  • 1 month later...
On 6/13/2017 at 10:10 PM, juandayz said:

well back to the reallity: @Ghostman  2 ways are better than 2.. here you got:

 

  Reveal hidden contents

 

 

  Reveal hidden contents

 

 

What about somehow tying the starter kit somehow to the player Id once they have claimed it. I was just testing this out and I relogged on my test server and now I don't have the option.

This way if we can somehow tie it to the player ID, they can at least come back later if they haven't found a spot yet to claim the kit.

Link to comment
Share on other sites

28 minutes ago, JohnnyBravo666 said:

What about somehow tying the starter kit somehow to the player Id once they have claimed it. I was just testing this out and I relogged on my test server and now I don't have the option.

This way if we can somehow tie it to the player ID, they can at least come back later if they haven't found a spot yet to claim the kit.

I do this on my server using extDB, on player login I run a query to see if the player has gotten their start kit yet, if not I addaction for the starterkit script.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...