Jump to content
  • 0

Donator gear with database


marsjee

Question

Hello,

So I used reality dayz package for a very long time. They have a very good working donator gear package with datavase function. I thought it would be cool and nice to have that in the epoch package aswell.

I'm not good at arma coding, I do understand the code when reading it but thats it.
Maybe someone here can help or maybe even the epoch dev crew wants this in a release ?
 

 

PlayerLogin.sqf

// Check custom inventory for new characters
if (_model == "") 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);
                };
        };
};


create table if not exists cust_loadout (
  id bigint unsigned not null auto_increment,
  inventory varchar(2048) not null,
  backpack varchar(2048) not null,
  model varchar(100) default null,
  
  primary key pk_cust_loadout (id)
) character set utf8 engine=InnoDB;
 
create table if not exists cust_loadout_profile (
  cust_loadout_id bigint unsigned not null,
  unique_id varchar(128) not null,
 
  primary key pk_cust_loadout_profile (cust_loadout_id, unique_id),
  foreign key fk1_cust_loadout_profile (cust_loadout_id) references cust_loadout (id),
  foreign key fk2_cust_loadout_profile (unique_id) references profile (unique_id)
) character set utf8 engine=InnoDB;

Anybody that can help me with this? Please let me know :)

Link to comment
Share on other sites

Recommended Posts

  • 0

Actually i went with a combo between AXEMAN's

	//Donator
	[] execVM "tools\donator.sqf";

in your init.sqf above the player monitor section, then with MYSTICVIPERX sqf in my fixes folder

//Default Loadout
DefaultMagazines = ["ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemWaterbottleBoiled","FoodSteakCooked"];
DefaultWeapons = ["glock17_EP1","ItemFlashlight","ItemHatchet"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";

//Admin Loadout
if ((getPlayerUID player) in ["########","#######","########"]) then {  //Admins: Name, Name, Name
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","20Rnd_B_AA12_74Slug","20Rnd_B_AA12_Pellets","20Rnd_B_AA12_Pellets","ItemGoldBar10oz"];
	DefaultWeapons = ["glock17_EP1","AA12_PMC","Binocular_Vector","NVGoggles","ItemMap","ItemCompass","ItemGPS","ItemWatch","ItemKnife","Itemtoolbox","ItemCrowbar","Itemetool","ItemHatchet"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Moderator Loadout
if ((getPlayerUID player) in ["########","########","#######","#########"]) then {   //Moderators: Name, Name, Name, Name
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","8Rnd_B_Saiga12_Pellets","8Rnd_B_Saiga12_Pellets","8Rnd_B_Saiga12_74Slug","ItemGoldBar10oz"];
	DefaultWeapons = ["glock17_EP1","Saiga12K","Binocular_Vector","NVGoggles","ItemMap","Itemtoolbox"];
	DefaultBackpack = "DZ_Backpack_EP1";
	DefaultBackpackWeapon = "";
	};

//Pro-Donator Loadout
if ((getPlayerUID player) in ["#########"]) then {  //Pro-Donators: 
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","8Rnd_B_Beneli_Pellets","8Rnd_B_Beneli_Pellets","8Rnd_B_Beneli_74Slug","ItemGoldBar10oz"];
	DefaultWeapons = ["M9SD","Remington870_lamp","Binocular","ItemMap","ItemCompass","ItemFlashlightRed","ItemKnife","ItemMatchbox","ItemHatchet"];
	DefaultBackpack = "DZ_GunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Donator Loadout
if ((getPlayerUID player) in ["#########"]) then {  //Donators: 
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemMorphine","ItemPainkiller","ItemGoldBar","15Rnd_W1866_Slug","15Rnd_W1866_Slug"];
	DefaultWeapons = ["glock17_EP1","Winchester1866","ItemMap","ItemFlashlightRed","ItemHatchet"];
	DefaultBackpack = "DZ_ALICE_Pack_EP1";
	DefaultBackpackWeapon = "";
	};

Modified for my server though...

And it worked like a charm.

 

So thnx to you both for the leading in the right direction and codes posted.

 

Bags

Link to comment
Share on other sites

  • 0

You're welcome, its a mix between asiankid, axeman, and me. Axeman's 'Switch' statement was correct, but for the life of me I coundn't get it to work, so short of axeman coming in and fixing my server it wasn't going to work for me. I built the 'if' script because im use to the logic.

 

I would like to rewrite this as a tutorial, but its not all my work so I don't want to set on any toes.

Link to comment
Share on other sites

  • 0

You're welcome, its a mix between asiankid, axeman, and me. Axeman's 'Switch' statement was correct, but for the life of me I coundn't get it to work, so short of axeman coming in and fixing my server it wasn't going to work for me. I built the 'if' script because im use to the logic.

I would like to rewrite this as a tutorial, but its not all my work so I don't want to set on any toes.

I think that would help so many people out ;) I would just ask them sure no one would mind

Link to comment
Share on other sites

  • 0

a quick question instead of using this

case ((getPlayerUID player) in ["9999999999","9999998331","999994"])  :  //Admins: 
        {
        DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","20Rnd_B_AA12_74Slug","20Rnd_B_AA12_74Slug","20Rnd_B_AA12_Pellets","ItemGoldBar10oz"];
        DefaultWeapons = ["glock17_EP1","AA12_PMC","Binocular_Vector","NVGoggles","ItemMap","ItemCompass","ItemGPS","ItemWatch","ItemKnife","Itemtoolbox","ItemCrowbar","Itemetool","ItemHatchet"];
        DefaultBackpack = "DZ_LargeGunBag_EP1";
        DefaultBackpackWeapon = "";
        };

how would I get it to run a file, I am using this but need to make sure it works

case ((getPlayerUID player) in ["9999999999","9999998331","999994"])  :  //Admins: 
{
            [] execVM "custom\donator.sqf"; //execute this file instead of list
}

Link to comment
Share on other sites

  • 0

ok I use a similar system, the guys helped me out with.

 

1st, in your init.sqf in your mission

find

if (!isDedicated) then {
[] execVM "fixes\Server_WelcomeCredits.sqf";
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	//_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
	_playerMonitor =     [] execFSM "fixes\player_monitor.fsm";	
	_void = [] execVM "R3F_Realism\R3F_Realism_Init.sqf";

and before the //run the player monitor add

//Donator
	[] execVM "fixes\donator.sqf";
	
	

so that it looks like this

if (!isDedicated) then {
[] execVM "fixes\Server_WelcomeCredits.sqf";
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

	//Donator
	[] execVM "fixes\donator.sqf";
	
	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	//_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
	_playerMonitor =     [] execFSM "fixes\player_monitor.fsm";	
	_void = [] execVM "R3F_Realism\R3F_Realism_Init.sqf";

Then in your fixes folder in the root of your mission pbo,

Create a new file and call it  donator.sqf

 

And put this code in it, and modify it for your server, remember to keep to the same format

//Default Loadout
DefaultMagazines = ["FoodSteakCooked","ItemSodaCoke","ItemBandage","ItemBandage","ItemPainkiller","ItemMorphine","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"];
DefaultWeapons = ["Makarov","ItemFlashlight","ItemMachete","Itemtoolbox"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackWeapon = "";

//Admin Loadout
if ((getPlayerUID player) in ["#########","########","########"]) then {  //Admins: Name, Name, Name
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","20Rnd_762x51_B_SCAR","20Rnd_762x51_B_SCAR","20Rnd_762x51_B_SCAR","ItemGoldBar10oz"];
	DefaultWeapons = ["M9SD","M110_NVG_EP1","Binocular_Vector","NVGoggles","ItemMap","ItemCompass","ItemGPS","ItemWatch","ItemKnife","Itemtoolbox","ItemCrowbar","Itemetool","ItemHatchet"];
	DefaultBackpack = "DZ_LargeGunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Moderator Loadout
if ((getPlayerUID player) in ["#########","########","#######","#########"]) then {   //Moderators: Name, Name, Name, Name
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemGoldBar10oz"];
	DefaultWeapons = ["M9SD","M4A1_AIM_SD_camo","Binocular_Vector","NVGoggles","ItemMap","Itemtoolbox"];
	DefaultBackpack = "DZ_Backpack_EP1";
	DefaultBackpackWeapon = "";
	};

//Pro-Donator Loadout
if ((getPlayerUID player) in ["#########","########","#######","#########"]) then {  //Pro-Donators: Name, Name, Name, Name  
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemWaterbottleBoiled","ItemWaterbottleBoiled","FoodSteakCooked","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","ItemGoldBar10oz"];
	DefaultWeapons = ["M9SD","M4A3_CCO_EP1","Binocular_Vector","NVGoggles","ItemMap","ItemCompass","Itemtoolbox","ItemFlashlightRed","ItemKnife","ItemMatchbox","ItemHatchet"];
	DefaultBackpack = "DZ_GunBag_EP1";
	DefaultBackpackWeapon = "";
	};

//Donator Loadout
if ((getPlayerUID player) in ["#########","########","#######","#########"]) then {  //Donators: Name, Name, Name, Name 
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemBandage","ItemMorphine","ItemPainkiller","ItemGoldBar","30Rnd_9x19_MP5","30Rnd_9x19_MP5"];
	DefaultWeapons = ["glock17_EP1","MP5A5","ItemMap","ItemFlashlightRed","ItemWatch","ItemHatchet","Itemtoolbox"];
	DefaultBackpack = "DZ_ALICE_Pack_EP1";
	DefaultBackpackWeapon = "";
	};

//Clan Loadout
if ((getPlayerUID player) in ["#########","########","#######","#########"]) then {  //CLAN: Name, Name, Name, Name 
	DefaultMagazines = ["ItemBandage","ItemBandage","ItemBandage","ItemWaterbottleBoiled","FoodSteakCooked","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemMorphine","ItemGoldBar","ItemPainkiller","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag"];
	DefaultWeapons = ["M9SD","M4A3_CCO_EP1","ItemMap","Itemtoolbox","ItemFlashlightRed","ItemWatch","ItemKnife","ItemMatchbox","ItemHatchet"];
	DefaultBackpack = "DZ_GunBag_EP1";
	DefaultBackpackWeapon = "";
	};

This way, lets me create a new loadout based on what I need at the time, and also let me modify it fairly easily... works for me anyway..

 

Pretty sure I got that right, if it don't work, let me know and I'll help you out mate, contact me via here.

 

Bags

 

p.s. edit for some spelling

Edited by Bags2247
Link to comment
Share on other sites

  • 0

This seems to work, (file names are different from what I have put.)
 

switch true do {
    case ((getPlayerUID player) in ["########"])  :   
        {
			loadout = [] execVM "custom_script\default.sqf";
        };
    case ((getPlayerUID player) in ["########"])  : 
        {
       			loadout = [] execVM "custom_script\default.sqf";
        };
    case ((getPlayerUID player) in ["########"])  : 
        {
       			loadout = [] execVM "custom_script\default.sqf";
        };
    case ((getPlayerUID player) in ["########"])  : 
        {
       			loadout = [] execVM "custom_script\default.sqf";
        };
    default  
        {
       			loadout = [] execVM "custom_script\default.sqf";
        };
};
Link to comment
Share on other sites

  • 0

This is not possible to do yet because CHILD:999/998 is not possible with epoch hives.

 

If any moderators or admins read this, when will this be implemented please as I really need this for my server?

ooo its possible because im using CHILD:999 right now on my server custom hive.dll

Link to comment
Share on other sites

  • 0

Can this be done server-side? and YES I did search extensively before posting this.

*figures* - After I post this I run across this:

server_playerlogin.sqf

can we do anything inside here ?

	
	//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;
	};
};

  or above this line

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

 

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...