Jump to content

[Alpha Release] Single Currency 3.0 & Storage DEFAULT HIVE ( No global banking).


Recommended Posts

I have installed the currency and it works but when i logoff and close my server my ingame money deletes...

Also i cannot access safes and lockboxs via the scoll menu to keep my coins safe.

Andy ideas?

 

One of the following. 

 

You did not edit or wrongly edit or edited the wrong files of:

 

  • player_serverSync
  • gearSet
  • fn_selfActions
Link to comment
Share on other sites

 

One of the following. 

 

You did not edit or wrongly edit or edited the wrong files of:

 

  • player_serverSync
  • gearSet
  • fn_selfActions

 

Ok i fixed one line of code in server sync but it still is not coming up with bank coins and take coins.

Also when i log off my inventory resets back to when i first install Coins

Thanks advance

 

EDIT

reset database "player"

i spawned with the gear i logged off with and the coins

Still having problems storing coins in storage units option doesn't apper

Link to comment
Share on other sites

Ok i fixed one line of code in server sync but it still is not coming up with bank coins and take coins.

Also when i log off my inventory resets back to when i first install Coins

Thanks advance

 

Go over the instructions again.

 

U oversee some steps or u edited wrong files m8. ( like files that never get called).  It's probably something stupid 

Link to comment
Share on other sites

D 5 )  TO remove the client side errors u getting add in your VARIABLES.SQF

s_givemoney_dialog = -1;
s_bank_dialog = -1;
s_bank_dialog2 = -1;

TO

dayz_resetSelfActions = {

Where is the Variables.sqf or do i skip this step

 

I redid every file and follew everything apart from this one.
also im not sure what to do in the gearset

 

Link to comment
Share on other sites

 

D 5 )  TO remove the client side errors u getting add in your VARIABLES.SQF

s_givemoney_dialog = -1;

s_bank_dialog = -1;

s_bank_dialog2 = -1;

TO

dayz_resetSelfActions = {

Where is the Variables.sqf or do i skip this step

 

I redid every file and follew everything apart from this one.

also im not sure what to do in the gearset

 

 

 

u just use my gearset and see it's activated in the config.

 

for the variables.sqf that's basic server knowledge. 

 

It won't interfere in any functionality tho

Link to comment
Share on other sites

So here we go, I have added the steps to the init.sqf file.

Can you please since this the 3 time installing the script look over the init file and tell me if it is correct, with your add-on?

INIT.SQF

/*

For DayZ Epoch
Addons Credits: Jetski Yanahui by Kol9yN, Zakat, Gerasimow9, YuraPetrov, zGuba, A.Karagod, IceBreakr, Sahbazz
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];
 
//REALLY IMPORTANT VALUES
dayZ_instance = 17; //The instance
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;
 
//disable greeting menu 
player setVariable ["BIS_noCoreConversations", true];
//disable radio messages to be heard and shown in the left lower corner of the screen
enableRadio false;
// May prevent "how are you civillian?" messages from NPC
enableSentences false;
 
// DayZ Epoch config
DZE_ConfigTrader = true;
spawnShoremode = 0; // Default = 1 (on shore)
spawnArea = 2500; // Default = 1500
MaxVehicleLimit = 275; // Default = 50
MaxDynamicDebris = 1; // Default = 100
dayz_MapArea = 14000; // Default = 10000
dayz_maxAnimals = 5; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0
DynamicVehicleDamageHigh = 100; // Default: 100
DZE_BuildOnRoads = false; // Default: False
DZE_SelfTransfuse = true;
DZE_selfTransfuse_Values = [12000, 15, 300];
 
//STEP A1
/*ZSC*/
DZE_ConfigTrader = true;
/*ZSC*/
 
EpochEvents = [["any","any","any","any",5,"crash_spawner"],["any","any","any","any",10,"crash_spawner"],["any","any","any","any",15,"supply_drop"],["any","any","any","any",25,"ikea"],["any","any","any","any",35,"supply_drop"],
["any","any","any","any",40,"crash_spawner"],["any","any","any","any",45,"supply_drop"],["any","any","any","any",50,"ikea"],["any","any","any","any",50,"truck"],["any","any","any","any",10,"Military"],["any","any","any","any",25,"Treasure"],["any","any","any","any",40,"Supplyitems"],["any","any","any","any",55,"Construction"]];
 
dayz_fullMoonNights = true;
dayz_minpos = -26000; 
dayz_maxpos = 26000;
DZE_PlotPole = [30,45];
dayz_sellDistance_vehicle = 15;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
dayz_paraSpawn = false;
DZE_GodModeBase = true;
DZE_BuildingLimit = 200;
MaxVehicleLimit = 350; // Default = 50
MaxMineVeins = 50;
 
//---------------------This is the fresh spawn loadout
 
DefaultMagazines = ["ItemBandage","ItemBandage","ItemMorphine","RH_8Rnd_9x19_Mksd","RH_8Rnd_9x19_Mksd","RH_8Rnd_9x19_Mksd","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag"]; 
DefaultWeapons = ["ItemMap","ItemToolBox","RH_mk22sd","M4A3_CCO_EP1"]; 
DefaultBackpack = "DZ_Assault_Pack_EP1"; 
DefaultBackpackWeapon = "";
 
//---------------------end of fresh spawn loadout
 
 
// DZEdebug = true;
 
//Load in compiled functions
call compile preprocessFileLineNumbers "custom\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf"; //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf"; //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
call compile preprocessFileLineNumbers "custom\snap_pro\compiles.sqf"; //Compile regular functions
 
//STEP A2
/*ZSC*/
call compile preprocessFileLineNumbers "ZSC\gold\ZSCinit.sqf";
/*ZSC*/
 
progressLoadingScreen 0.5;
 
//STEP A4
/*ZSC*/
call compile preprocessFileLineNumbers "server_traders_cherno_17.sqf";
/*ZSC*/
 
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0;
 
DZE_safeVehicle = ["ParachuteWest","ParachuteC","MMT_Civ","A10_US_EP1","L39_TK_EP1","HMMWV_M1151_M2_CZ_DES_EP1_DZ","BAF_Jackal2_L2A1_D","M2A2_EP1","BAF_Jackal2_L2A1_W"];
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
if (isServer) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_17.chernarus\dynamic_vehicle.sqf"; //Compile vehicle configs
 
// Add trader citys
_nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_17.chernarus\mission.sqf";
 
//STEP A5
/*ZSC*/
_serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
/*ZSC*/
 
};
 
if (!isDedicated) then {
[] execVM "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";
 
//STEP A3
/*ZSC*/
execVM "ZSC\compiles\playerHud.sqf";
/*ZSC*/
 
_nil = [] execVM "custom\JAEM\EvacChopper_init.sqf";
_nil = [] execVM "custom\VehicleKeyChanger\VehicleKeyChanger_init.sqf";
execVM "service_point\service_point.sqf";
 
// Safezone script
[] execVM "safezone.sqf";
 
//Lights
//[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
};
//#include "\z\addons\dayz_code\system\REsec.sqf"
 
//Start Dynamic Weather
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
 
#include "\z\addons\dayz_code\system\BIS_Effects\init.sqf"
 
//waitUntil {!isNil ("PVDZE_plr_LoginRecord")}; if (dayzPlayerLogin2 select 2) then { [] execVM "addons\DRNSpawn.sqf"; };
 
 
[]execVM "vehicles_addons\jets.sqf";//there is a unarmed L39_TK_EP1 at each airfield
[] spawn {[] execVM "custom\secbran.sqf";};
[] execVM "R3F_ARTY_AND_LOG\init.sqf";
execVM "rob\bank.sqf";
[]execVM "signs_flags\billboard.sqf";
 
[]execVM "signs_flags\flag.sqf";
 

[]execVM "signs_flags\trader_sign.sqf";

Link to comment
Share on other sites

Here is what i put in the description.ext file

description.ext

//STEP B1

/*ZSC*/
#include "ZSC\config\cfgServerTrader.hpp"
/*ZSC*/
 
respawn = "BASE";
respawndelay = 5;
onLoadMission="DayZ_Opoch-Origins Chernarus";
OnLoadIntro = "Welcome to Opoch-Origins Chernarus";
OnLoadIntroTime = False;
OnLoadMissionTime = False;
disabledAI = true;
disableChannels[]={0,2,6};
enableItemsDropping=0;
 
//OverpochLoot
#include "mods\CfgCustomLoot\CfgBuildingLoot.hpp"
//OverpochTraders
#include "mods\CfgServerTrader\cfgServerTrader.hpp"
 
briefing = 0;
debriefing = 0;
 
onPauseScript = "";
loadScreen = "epochorigins.jpg";
 
class Header
{
 gameType = COOP;            //DM, Team, Coop, ...
 minPlayers = 1;             //min # of players the mission supports
 maxPlayers = 100;            //Max # of players the mission supports
};
 
aiKills = 1;
diagRadio = 1;
diagHit = 1;
 
class RscText
{
type = 0;
idc = -1;
x = 0;
y = 0;
h = 0.037;
w = 0.3;
style = 0x100; 
font = Zeppelin32;
SizeEx = 0.03921;
colorText[] = {1,1,1,1};
colorBackground[] = {0, 0, 0, 0};
linespacing = 1;
};
class RscPicture
{
access=0;
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="TahomaB";
sizeEx=0;
lineSpacing=0;
text="";
};
class RscLoadingText : RscText
{
style = 2;
x = 0.323532;
y = 0.666672;
w = 0.352944;
h = 0.039216;
sizeEx = 0.03921;
colorText[] = {0.543,0.5742,0.4102,1.0};
};
class RscProgress
{
x = 0.344;
y = 0.619;
w = 0.313726;
h = 0.0261438;
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
colorFrame[] = {0,0,0,0};
colorBar[] = {1,1,1,1};
};
class RscProgressNotFreeze
{
idc = -1;
type = 45;
style = 0;
x = 0.022059;
y = 0.911772;
w = 0.029412;
h = 0.039216;
texture = "#(argb,8,8,3)color(0,0,0,0)";
};
 
//STEP B2
/*ZSC*/
class RscTitles
{
#include "ZSC\config\ZSChud.hpp"
};
/*ZSC*/
 
//
// the loading screen itself
//
class DayZ_loadingScreen
idd = -1;
duration = 10e10;
fadein = 0;
fadeout = 0;
name = "loading screen";
class controlsBackground
{
class blackBG : RscText
{
x = safezoneX;
y = safezoneY;
w = safezoneW;
h = safezoneH;
text = "";
colorText[] = {0,0,0,0};
colorBackground[] = {0,0,0,1};
};
/*
class nicePic : RscPicture
{
style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO
x = safezoneX + safezoneW/2 - 0.25;
y = safezoneY + safezoneH/2 - 0.2;
w = 0.5;
h = 0.4;
text = "img\nicePic.paa";
};
*/
};
class controls
{
class Title1 : RscLoadingText
{
text = "$STR_LOADING"; // "Loading" text in the middle of the screen
};
class CA_Progress : RscProgress // progress bar, has to have idc 104
{
idc = 104;
type = 8; // CT_PROGRESS
style = 0; // ST_SINGLE
texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
};
class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse
{
idc = 103;
};
class Name2: RscText // the text on the top-left
{
idc = 101;
x = 0.05;
y = 0.029412;
w = 0.9;
h = 0.04902;
text = "";
sizeEx = 0.05;
colorText[] = {0.543,0.5742,0.4102,1.0};
};
};
};
#include "addons\DRNdialogs.hpp"
#include "custom\extra_rc.hpp"
 
class CfgSounds
{
sounds[] = {vendingmachine};
 
class DoorCreak
    {
name="DoorCreak";
sound[]={sounds\doorCreak.ogg, 0.1, 1};
titles[] = {};
    };
class metalGates
    {
name="metalGates";
sound[]={sounds\metalGates.ogg, 0.1, 1};
titles[] = {};
    };
class stronghold
{
name = "stronghold";
sound[] = {sounds\vrata_sound.ogg,0.1,1};
titles[] = {};
    };
class vendingmachine
    {
    name="vendingmachine";
    sound[]={Vending\vendingmachine.ogg,0.9,1};
    titles[] = {};
};
};
 
#include "custom\snap_pro\snappoints.hpp"
 
//STEP B3
/*ZSC*/
#include "ZSC\config\ZSCdefines.hpp"
#include "ZSC\config\ZSCdialogs.hpp"
/*ZSC*/
 
//STEP B4
/*ZSC*/
DID NOT COME FROM ANY COIN SYSTEM
/*ZSC*/
 

 

In step C1 i put the ZSC folder in the mission root.

Step C2 i put your server_traders_cherno_17.sqf in the mission root.

Will wait to hear from you before moving on.

Link to comment
Share on other sites

i change function for add humanity to 
 

admincashMoneyPlus =
	{
		{
			if (name _x == _this select 0) then
			{
				_humanity = _x getVariable["cashMoney",0];
				_x setVariable["cashMoney",_cashMoney+100000,true];
				hint format["Gave %1 +100000 cashMoney!",_this select 0];
				
				_sl = format["%1 plus 100000 cashMoney to %2",name player,_this select 0];
				RGTA_WriteLogReq = [player,_sl];
				publicVariableServer "RGTA_WriteLogReq";
			};
		} forEach playableUnits;
	};

coint don't added to players

Link to comment
Share on other sites

Just used only your files everything works as intended i think infiSTAR is messing up something in my server.pbo or either its R3f towing that always screws me

 

EDIT

I narrowed it down to r3f towing and snap pro in the mission.sqm

Link to comment
Share on other sites

//STEP C SERVER SIDE you say to do the following 
 
Put this 
if( count (_intentory) > 3)then{
_object setVariable ["bankMoney", _intentory select 3, true];
}else{
       _object setVariable ["bankMoney", 0, true];
};
/*ZSC*/
ABOVE THIS above the following
 
if (_type in DZE_LockedStorage) then {
// Fill variables with loot
_object setVariable ["WeaponCargo", (_intentory select 0),true];
_object setVariable ["MagazineCargo", (_intentory select 1),true];
_object setVariable ["BackpackCargo", (_intentory select 2),true];
} else {
 
MY SERVER_MONITOR.SQF HAS THIS LINE      if (count _intentory > 0) then {
IT LOOKS LIKE THIS,
 
if (count _intentory > 0) then {
if (_type in DZE_LockedStorage) then {
// Fill variables with loot
_object setVariable ["WeaponCargo", (_intentory select 0),true];
_object setVariable ["MagazineCargo", (_intentory select 1),true];
_object setVariable ["BackpackCargo", (_intentory select 2),true];
} else {
 
I ASKED ABOUT THIS ONCE BEFORE. What should i do about that line. Should i remove this (if (count _intentory > 0) then {) or what?
 
Thank you in advance for your help
Link to comment
Share on other sites

 

I ASKED ABOUT THIS ONCE BEFORE. What should i do about that line. Should i remove this (if (count _intentory > 0) then {) or what?

 

 

Add it inbetween.

 

if (count _intentory > 0) then {


if( count (_intentory) > 3)then{
       _object setVariable ["bankMoney", _intentory select 3, true];
}else{
       _object setVariable ["bankMoney", 0, true];
};


if (_type in DZE_LockedStorage) then {
      // Fill variables with loot
      _object setVariable ["WeaponCargo", (_intentory select 0),true];
      _object setVariable ["MagazineCargo", (_intentory select 1),true];
      _object setVariable ["BackpackCargo", (_intentory select 2),true];
} else {
Link to comment
Share on other sites

 

Add it inbetween.

 

if (count _intentory > 0) then {


if( count (_intentory) > 3)then{
       _object setVariable ["bankMoney", _intentory select 3, true];
}else{
       _object setVariable ["bankMoney", 0, true];
};


if (_type in DZE_LockedStorage) then {
      // Fill variables with loot
      _object setVariable ["WeaponCargo", (_intentory select 0),true];
      _object setVariable ["MagazineCargo", (_intentory select 1),true];
      _object setVariable ["BackpackCargo", (_intentory select 2),true];
} else {

thank you will give it a try

Link to comment
Share on other sites

I have went over this script over and over. Here is where i am. Money saves to me after restart. I can put money in safes and vehicles. I can lock the safes and vehicles and after unlocking them, the money i put in them is there. When i do a restart all moneys in safes and vehicles go away, reset to 0. The only moneys that stay after restart is the money i have on me. 

I have put many scripts in on our servers, anything from RF3, deploy bike, wai, and missions and more, BUT this one has me beat. I know im not as smart as most in scripting, I guess im done unless someone know what my problem is.

Link to comment
Share on other sites

OK, after a good night sleep and a clear head and the help from calamity . I DID IT. 

I got it to work. The problem was in the server_updateObject.sqf, there was two places that had 

 

_inventory = [
            getWeaponCargo _object,
            getMagazineCargo _object,
            getBackpackCargo _object
        
];

 

So like i said, clear head. I decided to try it on the other one and it worked. I will put the file below that i am using so others can see. 

FIRST ONE ON LINE 66 AND SECOND ONE ON LINE 193

/*

[_object,_type] spawn server_updateObject;
*/
private ["_L39_TK_EP1","_object","_type","_objectID","_uid","_lastUpdate","_needUpdate","_object_position","_object_inventory","_object_damage","_isNotOk","_parachuteWest","_firstTime","_object_killed","_object_repair","_isbuildable","_object_vehicleKey","_activatingPlayer","_vehicleClassname","_toKey","_toKeyName","_vehicle_ID","_vehicle_UID"];
 
_object = _this select 0;
 
if(isNull(_object)) exitWith {
diag_log format["Skipping Null Object: %1", _object];
};
 
_type = _this select 1;
_parachuteWest = ((typeOf _object == "ParachuteWest") || (typeOf _object == "ParachuteC"));
_L39_TK_EP1 = (typeOf _object == "L39_TK_EP1");
_isbuildable = (typeOf _object) in dayz_allowedObjects;
_isNotOk = false;
_firstTime = false;
 
_objectID = _object getVariable ["ObjectID","0"];
_uid = _object getVariable ["ObjectUID","0"];
 
if ((typeName _objectID != "string") || (typeName _uid != "string")) then
    diag_log(format["Non-string Object: ID %1 UID %2", _objectID, _uid]);
    //force fail
    _objectID = "0";
    _uid = "0";
};
if (!_L39_TK_EP1 && !_parachuteWest && !(locked _object)) then {
if (_objectID == "0" && _uid == "0") then
{
_object_position = getPosATL _object;
    _isNotOk = true;
};
};
 
// do not update if buildable && not ok
if (_isNotOk && _isbuildable) exitWith {  };
 
// delete if still not ok
if (_isNotOk) exitWith { deleteVehicle _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",typeOf _object,_object_position select 0,_object_position select 1, _object_position select 2]); };
 
 
_lastUpdate = _object getVariable ["lastUpdate",time];
_needUpdate = _object in needUpdate_objects;
 
// TODO ----------------------
_object_position = {
private["_position","_worldspace","_fuel","_key"];
_position = getPosATL _object;
_worldspace = [
round(direction _object),
_position
];
_fuel = 0;
if (_object isKindOf "AllVehicles") then {
_fuel = fuel _object;
};
_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
 
_object_inventory = {
private["_inventory","_previous","_key"];
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
 
 
//STEP B
/*ZSC*/
, _object getVariable["bankMoney",0]
/*ZSC*/
 
];
_previous = str(_object getVariable["lastInventory",[]]);
if (str(_inventory) != _previous) then {
_object setVariable["lastInventory",_inventory];
if (_objectID == "0") then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};
 
_object_damage = {
private["_hitpoints","_array","_hit","_selection","_key","_damage"];
_hitpoints = _object call vehicle_getHitpoints;
_damage = damage _object;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_object setHit ["_selection", _hit];
} count _hitpoints;
 
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_object setVariable ["needUpdate",false,true];
};
 
_object_killed = {
private["_hitpoints","_array","_hit","_selection","_key","_damage"];
_hitpoints = _object call vehicle_getHitpoints;
//_damage = damage _object;
_damage = 1;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_hit = 1;
_object setHit ["_selection", _hit];
} count _hitpoints;
 
if (_objectID == "0") then {
_key = format["CHILD:306:%1:%2:%3:",_uid,_array,_damage];
} else {
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_object setVariable ["needUpdate",false,true];
if ((count _this) > 2) then {
_killer = _this select 2;
_charID = _object getVariable ['CharacterID','0'];
_objID = _object getVariable['ObjectID','0'];
_objUID = _object getVariable['ObjectUID','0'];
_worldSpace = getPosATL _object;
if (getPlayerUID _killer != "") then {
_name = if (alive _killer) then { name _killer; } else { format["OBJECT %1", _killer]; };
diag_log format["Vehicle killed: Vehicle %1 (TYPE: %2), CharacterID: %3, ObjectID: %4, ObjectUID: %5, Position: %6, Killer: %7 (UID: %8)", _object, (typeOf _object), _charID, _objID, _objUID, _worldSpace, _name, (getPlayerUID _killer)];
} else {
diag_log format["Vehicle killed: Vehicle %1 (TYPE: %2), CharacterID: %3, ObjectID: %4, ObjectUID: %5, Position: %6", _object, (typeOf _object), _charID, _objID, _objUID, _worldSpace];
};
};
};
 
_object_repair = {
private["_hitpoints","_array","_hit","_selection","_key","_damage"];
_hitpoints = _object call vehicle_getHitpoints;
_damage = damage _object;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_object setHit ["_selection", _hit];
} count _hitpoints;
 
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_object setVariable ["needUpdate",false,true];
};
 
_object_vehicleKey = {
private ["_hit","_selection","_fuel","_gotcha","_retry","_vehicleID","_key","_result","_outcome","_player","_class","_newKey","_newKeyName","_oldVehicleID","_oldVehicleUID","_hitpoints","_damage","_array","_inventory","_vehicleUID","_position","_dir","_worldspace"];
 
/* Setting up variables */
_player = _this select 0;
_class = _this select 1;
_newKey = _this select 2;
_newKeyName = _this select 3;
_oldVehicleID = _this select 4;
_oldVehicleUID = _this select 5;
 
/* Get Damage of the Vehicle */
_hitpoints = _object call vehicle_getHitpoints;
_damage = damage _object;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_object setHit ["_selection", _hit];
} forEach _hitpoints;
 
/* Get the Fuel of the Vehicle */
_fuel = 0;
if (_object isKindOf "AllVehicles") then {
_fuel = fuel _object;
};
 
/* Get the Inventory of the Vehicle */
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
 
];
 
/* Get the position of the Vehicle */
_position = getPosASL _object;
if !(surfaceIsWater _position) then {
_position =  ASLToATL _position;
};
_dir = getDir _object;
_worldspace = [_dir,_position];
 
/* Delete the current Database entry */
[_oldVehicleID,_oldVehicleUID,_player] call server_deleteObj;
sleep 1;
 
/* Generate a new UID */
_vehicleUID = _worldspace call dayz_objectUID3;
 
/* Write the new Database entry and LOG the action*/
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _newKey, _worldspace, _inventory, _array, _fuel,_vehicleUID];
_key call server_hiveWrite;
diag_log ("HIVE: WRITE: VEHICLE KEY CHANGER: "+ str(_key)); 
diag_log format["HIVE: WRITE: VEHICLE KEY CHANGER: Vehicle:%1 NewKey:%2 BY %3(%4)", _object, _newKeyName, (name _player), (getPlayerUID _player)];
 
/* Get the ObjectID of the entry in the Database */
_retry = 0;
_gotcha = false;
while {!_gotcha && _retry < 10} do {
sleep 1;
 
/* Send the request */
_key = format["CHILD:388:%1:",_vehicleUID];
diag_log ("HIVE: READ: VEHICLE KEY CHANGER: "+ str(_key));
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
 
/* We got a answer */
if (_outcome == "PASS") then {
_vehicleID = _result select 1;
 
/* Compare with old ObjectID to check if it not was deleted yet */
if (_oldVehicleID == _vehicleID) then {
/* Not good lets give it another try */
_gotcha = false;
_retry = _retry + 1;
} else {
/* GOTCHA! */
diag_log("CUSTOM: VEHICLE KEY CHANGER: Selected " + str(_vehicleID));
_gotcha = true;
_retry = 11;
 
_object setVariable ["VKC_disabled", 1,true];
_object setVariable ["VKC_claiming_disabled", 1,true];
 
[_object] spawn {
private ["_veh"];
_veh = _this select 0;
 
sleep 30;
_veh setVariable ["VKC_disabled", 0,true];
_veh setVariable ["VKC_claiming_disabled", 0,true];
};
 
PVDZE_vkc_Success = true;
(owner _player) publicVariableClient "PVDZE_vkc_Success";
 
/* Lock the Vehicle */
_object setVehicleLock "locked";
 
/* Save the ObjectID and ObjectUID to the vehicles variable and make it public */
_object setVariable ["ObjectID", _vehicleID, true];
_object setVariable ["ObjectUID", _vehicleUID, true];
 
/* Set the lastUpdate time to current */
_object setVariable ["lastUpdate",time,true];
 
/* Set the CharacterID to the new Key so we can access it! */
_object setVariable ["CharacterID", _newKey, true];
 
/* Some other variables you might need for disallow lift/tow/cargo locked Vehicles and such */
/* Uncomment if you use this */
 
/* R3F Arty and LOG block lift/tow/cargo locked vehicles*/
_object setVariable ["R3F_LOG_disabled",true,true];
 
/* =BTC= Logistic block lift locked vehicles*/
_object setVariable ["BTC_Cannot_Lift",true,true];
};
} else {
/* Something went wrong on the request give it another try */
diag_log("CUSTOM: VEHICLE KEY CHANGER: trying again to get id for: " + str(_vehicleUID));
_gotcha = false;
_retry = _retry + 1;
};
};
};
// TODO ----------------------
 
_object setVariable ["lastUpdate",time,true];
switch (_type) do {
case "all": {
call _object_position;
call _object_inventory;
call _object_damage;
};
case "position": {
if (!(_object in needUpdate_objects)) then {
//diag_log format["DEBUG Position: Added to NeedUpdate=%1",_object];
needUpdate_objects set [count needUpdate_objects, _object];
};
};
case "gear": {
call _object_inventory;
};
case "damage": {
if ( (time - _lastUpdate) > 5) then {
call _object_damage;
} else {
if (!(_object in needUpdate_objects)) then {
//diag_log format["DEBUG Damage: Added to NeedUpdate=%1",_object];
needUpdate_objects set [count needUpdate_objects, _object];
};
};
};
case "killed": {
call _object_killed;
};
case "repair": {
call _object_damage;
};
    case "vehiclekey": {
_activatingPlayer = _this select 2;
_vehicleClassname = _this select 3;
_toKey = _this select 4;
_toKeyName = _this select 5;
_vehicle_ID = _this select 6;
_vehicle_UID = _this select 7;
[_activatingPlayer, _vehicleClassname, _toKey, _toKeyName, _vehicle_ID, _vehicle_UID] call _object_vehicleKey;;
};
};
 

!

 

BTW ZUPA, Thank you for the script and sorry for being such a pain in the, ask me where. lol

Link to comment
Share on other sites

edit in fnselfaction

 

if (_isMan and _isAlive and !_isZombie and !_isAnimal and !(_traderType in serverTraders)) then {

add grave

what i have below, is that correct?

if (_grave and _isMan and _isAlive and !_isZombie and !_isAnimal and !(_traderType in serverTraders)) then {

Link to comment
Share on other sites

OK, after a good night sleep and a clear head and the help from calamity . I DID IT. 

I got it to work. The problem was in the server_updateObject.sqf, there was two places that had 

 

_inventory = [

            getWeaponCargo _object,

            getMagazineCargo _object,

            getBackpackCargo _object

        ];

 

So like i said, clear head. I decided to try it on the other one and it worked. I will put the file below that i am using so others can see. 

FIRST ONE ON LINE 66 AND SECOND ONE ON LINE 193

/*

[_object,_type] spawn server_updateObject;
*/
private ["_L39_TK_EP1","_object","_type","_objectID","_uid","_lastUpdate","_needUpdate","_object_position","_object_inventory","_object_damage","_isNotOk","_parachuteWest","_firstTime","_object_killed","_object_repair","_isbuildable","_object_vehicleKey","_activatingPlayer","_vehicleClassname","_toKey","_toKeyName","_vehicle_ID","_vehicle_UID"];
 
_object = _this select 0;
 
if(isNull(_object)) exitWith {
diag_log format["Skipping Null Object: %1", _object];
};
 
_type = _this select 1;
_parachuteWest = ((typeOf _object == "ParachuteWest") || (typeOf _object == "ParachuteC"));
_L39_TK_EP1 = (typeOf _object == "L39_TK_EP1");
_isbuildable = (typeOf _object) in dayz_allowedObjects;
_isNotOk = false;
_firstTime = false;
 
_objectID = _object getVariable ["ObjectID","0"];
_uid = _object getVariable ["ObjectUID","0"];
 
if ((typeName _objectID != "string") || (typeName _uid != "string")) then
    diag_log(format["Non-string Object: ID %1 UID %2", _objectID, _uid]);
    //force fail
    _objectID = "0";
    _uid = "0";
};
if (!_L39_TK_EP1 && !_parachuteWest && !(locked _object)) then {
if (_objectID == "0" && _uid == "0") then
{
_object_position = getPosATL _object;
    _isNotOk = true;
};
};
 
// do not update if buildable && not ok
if (_isNotOk && _isbuildable) exitWith {  };
 
// delete if still not ok
if (_isNotOk) exitWith { deleteVehicle _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",typeOf _object,_object_position select 0,_object_position select 1, _object_position select 2]); };
 
 
_lastUpdate = _object getVariable ["lastUpdate",time];
_needUpdate = _object in needUpdate_objects;
 
// TODO ----------------------
_object_position = {
private["_position","_worldspace","_fuel","_key"];
_position = getPosATL _object;
_worldspace = [
round(direction _object),
_position
];
_fuel = 0;
if (_object isKindOf "AllVehicles") then {
_fuel = fuel _object;
};
_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
 
_object_inventory = {
private["_inventory","_previous","_key"];
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
 
 
//STEP B
/*ZSC*/
, _object getVariable["bankMoney",0]
/*ZSC*/
 
];
_previous = str(_object getVariable["lastInventory",[]]);
if (str(_inventory) != _previous) then {
_object setVariable["lastInventory",_inventory];
if (_objectID == "0") then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};
 
_object_damage = {
private["_hitpoints","_array","_hit","_selection","_key","_damage"];
_hitpoints = _object call vehicle_getHitpoints;
_damage = damage _object;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_object setHit ["_selection", _hit];
} count _hitpoints;
 
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_object setVariable ["needUpdate",false,true];
};
 
_object_killed = {
private["_hitpoints","_array","_hit","_selection","_key","_damage"];
_hitpoints = _object call vehicle_getHitpoints;
//_damage = damage _object;
_damage = 1;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_hit = 1;
_object setHit ["_selection", _hit];
} count _hitpoints;
 
if (_objectID == "0") then {
_key = format["CHILD:306:%1:%2:%3:",_uid,_array,_damage];
} else {
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_object setVariable ["needUpdate",false,true];
if ((count _this) > 2) then {
_killer = _this select 2;
_charID = _object getVariable ['CharacterID','0'];
_objID = _object getVariable['ObjectID','0'];
_objUID = _object getVariable['ObjectUID','0'];
_worldSpace = getPosATL _object;
if (getPlayerUID _killer != "") then {
_name = if (alive _killer) then { name _killer; } else { format["OBJECT %1", _killer]; };
diag_log format["Vehicle killed: Vehicle %1 (TYPE: %2), CharacterID: %3, ObjectID: %4, ObjectUID: %5, Position: %6, Killer: %7 (UID: %8)", _object, (typeOf _object), _charID, _objID, _objUID, _worldSpace, _name, (getPlayerUID _killer)];
} else {
diag_log format["Vehicle killed: Vehicle %1 (TYPE: %2), CharacterID: %3, ObjectID: %4, ObjectUID: %5, Position: %6", _object, (typeOf _object), _charID, _objID, _objUID, _worldSpace];
};
};
};
 
_object_repair = {
private["_hitpoints","_array","_hit","_selection","_key","_damage"];
_hitpoints = _object call vehicle_getHitpoints;
_damage = damage _object;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_object setHit ["_selection", _hit];
} count _hitpoints;
 
_key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_object setVariable ["needUpdate",false,true];
};
 
_object_vehicleKey = {
private ["_hit","_selection","_fuel","_gotcha","_retry","_vehicleID","_key","_result","_outcome","_player","_class","_newKey","_newKeyName","_oldVehicleID","_oldVehicleUID","_hitpoints","_damage","_array","_inventory","_vehicleUID","_position","_dir","_worldspace"];
 
/* Setting up variables */
_player = _this select 0;
_class = _this select 1;
_newKey = _this select 2;
_newKeyName = _this select 3;
_oldVehicleID = _this select 4;
_oldVehicleUID = _this select 5;
 
/* Get Damage of the Vehicle */
_hitpoints = _object call vehicle_getHitpoints;
_damage = damage _object;
_array = [];
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
_object setHit ["_selection", _hit];
} forEach _hitpoints;
 
/* Get the Fuel of the Vehicle */
_fuel = 0;
if (_object isKindOf "AllVehicles") then {
_fuel = fuel _object;
};
 
/* Get the Inventory of the Vehicle */
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
 
];
 
/* Get the position of the Vehicle */
_position = getPosASL _object;
if !(surfaceIsWater _position) then {
_position =  ASLToATL _position;
};
_dir = getDir _object;
_worldspace = [_dir,_position];
 
/* Delete the current Database entry */
[_oldVehicleID,_oldVehicleUID,_player] call server_deleteObj;
sleep 1;
 
/* Generate a new UID */
_vehicleUID = _worldspace call dayz_objectUID3;
 
/* Write the new Database entry and LOG the action*/
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _newKey, _worldspace, _inventory, _array, _fuel,_vehicleUID];
_key call server_hiveWrite;
diag_log ("HIVE: WRITE: VEHICLE KEY CHANGER: "+ str(_key)); 
diag_log format["HIVE: WRITE: VEHICLE KEY CHANGER: Vehicle:%1 NewKey:%2 BY %3(%4)", _object, _newKeyName, (name _player), (getPlayerUID _player)];
 
/* Get the ObjectID of the entry in the Database */
_retry = 0;
_gotcha = false;
while {!_gotcha && _retry < 10} do {
sleep 1;
 
/* Send the request */
_key = format["CHILD:388:%1:",_vehicleUID];
diag_log ("HIVE: READ: VEHICLE KEY CHANGER: "+ str(_key));
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
 
/* We got a answer */
if (_outcome == "PASS") then {
_vehicleID = _result select 1;
 
/* Compare with old ObjectID to check if it not was deleted yet */
if (_oldVehicleID == _vehicleID) then {
/* Not good lets give it another try */
_gotcha = false;
_retry = _retry + 1;
} else {
/* GOTCHA! */
diag_log("CUSTOM: VEHICLE KEY CHANGER: Selected " + str(_vehicleID));
_gotcha = true;
_retry = 11;
 
_object setVariable ["VKC_disabled", 1,true];
_object setVariable ["VKC_claiming_disabled", 1,true];
 
[_object] spawn {
private ["_veh"];
_veh = _this select 0;
 
sleep 30;
_veh setVariable ["VKC_disabled", 0,true];
_veh setVariable ["VKC_claiming_disabled", 0,true];
};
 
PVDZE_vkc_Success = true;
(owner _player) publicVariableClient "PVDZE_vkc_Success";
 
/* Lock the Vehicle */
_object setVehicleLock "locked";
 
/* Save the ObjectID and ObjectUID to the vehicles variable and make it public */
_object setVariable ["ObjectID", _vehicleID, true];
_object setVariable ["ObjectUID", _vehicleUID, true];
 
/* Set the lastUpdate time to current */
_object setVariable ["lastUpdate",time,true];
 
/* Set the CharacterID to the new Key so we can access it! */
_object setVariable ["CharacterID", _newKey, true];
 
/* Some other variables you might need for disallow lift/tow/cargo locked Vehicles and such */
/* Uncomment if you use this */
 
/* R3F Arty and LOG block lift/tow/cargo locked vehicles*/
_object setVariable ["R3F_LOG_disabled",true,true];
 
/* =BTC= Logistic block lift locked vehicles*/
_object setVariable ["BTC_Cannot_Lift",true,true];
};
} else {
/* Something went wrong on the request give it another try */
diag_log("CUSTOM: VEHICLE KEY CHANGER: trying again to get id for: " + str(_vehicleUID));
_gotcha = false;
_retry = _retry + 1;
};
};
};
// TODO ----------------------
 
_object setVariable ["lastUpdate",time,true];
switch (_type) do {
case "all": {
call _object_position;
call _object_inventory;
call _object_damage;
};
case "position": {
if (!(_object in needUpdate_objects)) then {
//diag_log format["DEBUG Position: Added to NeedUpdate=%1",_object];
needUpdate_objects set [count needUpdate_objects, _object];
};
};
case "gear": {
call _object_inventory;
};
case "damage": {
if ( (time - _lastUpdate) > 5) then {
call _object_damage;
} else {
if (!(_object in needUpdate_objects)) then {
//diag_log format["DEBUG Damage: Added to NeedUpdate=%1",_object];
needUpdate_objects set [count needUpdate_objects, _object];
};
};
};
case "killed": {
call _object_killed;
};
case "repair": {
call _object_damage;
};
    case "vehiclekey": {
_activatingPlayer = _this select 2;
_vehicleClassname = _this select 3;
_toKey = _this select 4;
_toKeyName = _this select 5;
_vehicle_ID = _this select 6;
_vehicle_UID = _this select 7;
[_activatingPlayer, _vehicleClassname, _toKey, _toKeyName, _vehicle_ID, _vehicle_UID] call _object_vehicleKey;;
};
};
 

!

 

BTW ZUPA, Thank you for the script and sorry for being such a pain in the, ask me where. lol

great, now you get to add

Link to comment
Share on other sites

I have problem with long time of loading server after restart (100s) when I use your scripts. This is normal? How can I improve it? I use xampp and I chacked mysql and its same problem.

 

key_buffer = 25M
max_allowed_packet = 2M
sort_buffer_size = 1M
net_buffer_length = 8K
read_buffer_size = 1M
read_rnd_buffer_size = 1M
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...