Jump to content

DukeRevenger

Member
  • Content Count

    16
  • Joined

  • Last visited

  • Medals

Community Reputation

2 Neutral

About DukeRevenger

  • Rank
    Private First Class
  1. Right to assist the bambies that gotten same confused as i have, This is how i got mine working in the end ; Init.sqf call compile preProcessFile "\iniDB\init.sqf"; call compile preProcessFile "Arma3functions.sqf"; execVM "load.sqf"; abc_LoadplayerPos = { private ["_loadpos"]; _loadpos = _this select 0; _Profile = format["%1", getPlayerUID _loadpos]; _Pos = [_Profile, "playerData", "position", "ARRAY"] call iniDB_read; _weaponadd = [_Profile, "playerData", "weapons", "ARRAY"] call iniDB_read; _weaponadd1 = [_Profile, "playerData", "weapons1", "STING"] call iniDB_read; _itemsadd = [_Profile, "playerData", "magazines", "ARRAY"] call iniDB_read; _vestadd = [_Profile, "playerData", "vest", "STING"] call iniDB_read; _uniformadd = [_Profile, "playerData", "uniform", "STING"] call iniDB_read; _helmetadd = [_Profile, "playerData", "headgear", "STING"] call iniDB_read; _loadpos setpos _Pos; for "_i" from 0 to (count _itemsadd) do {_loadpos addMagazine (_itemsadd select _i)}; for "_y" from 0 to (count _weaponadd) do {_loadpos addweapon (_weaponadd select _y)}; _loadpos addvest _vestadd; _loadpos adduniform _uniformadd; _loadpos addheadgear _helmetadd; hint format["%1",_pos]; // Code goes here! }; if(isServer) then { [] execVM "save.sqf";}; Load.sqf player addbackpack "B_Bergen_sgg"; removeallweapons player; removeuniform player; removeheadgear player; removevest player; [player] call abc_LoadplayerPosServer; Save.sqf if(isServer) then { while{true} do { { if(isPlayer _x) then { sleep 5; _Profile = format["%1", getPlayerUID _x]; [_Profile, "playerData", "position", position _x] call iniDB_write; [_Profile, "playerData", "Playername", name _x] call iniDB_write; [_Profile, "playerData", "magazines", magazines _x] call iniDB_write; [_Profile, "playerData", "weapons", Weapons _x] call iniDB_write; [_Profile, "playerData", "weapons1", SecondaryWeapon _x] call iniDB_write; [_Profile, "playerData", "vest", vest _x] call iniDB_write; [_Profile, "playerData", "uniform", uniform _x] call iniDB_write; [_Profile, "playerData", "headgear", headgear _x] call iniDB_write; [_Profile, "playerData", "items", items _x] call iniDB_write; }; } forEach allUnits; } }; and the Arma3functions - Generated file via using ASCOM Framework // Do not edit this file! // This file may only be edited by Engima's ASCOM Editor! // // <ASCOM version="1"> // <Prefix>abc_</Prefix> // <Functions> // <Function Name="LoadplayerPos" Params="loadpos" Ret="false" A="false" C="false" S="true" O="false" OC="false" P="false" /> // <Function Name="LoadPlayerWeapon" Params="weapon" Ret="false" A="false" C="false" S="true" O="false" OC="false" P="false" /> // </Functions> // </ASCOM> ASCOM_ClientID = 0; ASCOM_CallID = 0; ASCOM_LastCallID = 0; ASCOM_LockCallID = 0; "abc_LoadplayerPosEventArgs" addPublicVariableEventHandler { private ["_array"]; _array = _this select 1; _array spawn { if ((_this select 0 == "A") || (_this select 0 == "C" && !isDedicated)) then { (_this select 1) call abc_LoadplayerPos; }; if (_this select 0 == "S" && isServer) then { (_this select 1) call abc_LoadplayerPos; }; }; }; abc_LoadplayerPosServer = { if (isNil "_this") then { _this = []; }; if (isServer) then { _this call abc_LoadplayerPos; } else { abc_LoadplayerPosEventArgs = ["S", _this]; publicVariable "abc_LoadplayerPosEventArgs"; abc_LoadplayerPosEventArgs = []; }; }; "abc_LoadPlayerWeaponEventArgs" addPublicVariableEventHandler { private ["_array"]; _array = _this select 1; _array spawn { if ((_this select 0 == "A") || (_this select 0 == "C" && !isDedicated)) then { (_this select 1) call abc_LoadPlayerWeapon; }; if (_this select 0 == "S" && isServer) then { (_this select 1) call abc_LoadPlayerWeapon; }; }; }; abc_LoadPlayerWeaponServer = { if (isNil "_this") then { _this = []; }; if (isServer) then { _this call abc_LoadPlayerWeapon; } else { abc_LoadPlayerWeaponEventArgs = ["S", _this]; publicVariable "abc_LoadPlayerWeaponEventArgs"; abc_LoadPlayerWeaponEventArgs = []; }; }; if (isServer) then { "ASCOM_AskForClientID" addPublicVariableEventHandler { private ["_unit"]; _unit = _this select 1; ASCOM_AskForClientID = []; ASCOM_LastCallID = ASCOM_LastCallID + 1; ASCOM_ClientIDResponse = [_unit, ASCOM_LastCallID]; publicVariable "ASCOM_ClientIDResponse"; }; ASCOM_ServerInitialized = true; publicVariable "ASCOM_ServerInitialized"; ASCOM_Initialized = true; } else { "ASCOM_ClientIDResponse" addPublicVariableEventHandler { private ["_array"]; _array = _this select 1; ASCOM_ClientIDResponse = []; if (player == (_array select 0)) then { ASCOM_ClientID = _array select 1; ASCOM_Initialized = true; }; }; waitUntil {!isNull player}; ASCOM_AskForClientID = player; publicVariable "ASCOM_AskForClientID"; }; This works for me and players on my server to save most gear + pos,
  2. I got my load sorting working via varibles, exept that people port onto my location not their own so close! .. yet so far
  3. Diden't mean chains, ment the icon in server list for missmatch on addons :p ain't it suppose to be server only?
  4. Arrgg.. still no success here, i'm defo doing something wrong Is it suppose to be running of the init.sqf as posted above or where am i failing, plus server gets the yellow mark when running @inidb :/
  5. Am i doing something wrong in my init file if it looks like call compile preProcessFile "\iniDB\init.sqf"; 0=this execVM "playerinit.sqf"; if(isServer) then { [] execVM "save.sqf";}; as it still seems to only load the clients ini files not servers
  6. that is fully correct and i won't deny the fact i did not read up on SQF I learnt by misstake/people's help mostly, but even with this given, I can't get it to work, I start beliving my IQ is to low to execute this correctly :p also gonna include This is my init call compile preProcessFile "\iniDB\init.sqf"; if(isServer) then { [] execVM "save.sqf";}; save.sqf if(isServer) then { while{true} do { { if(isPlayer _x) then { sleep 5; _Profile = format["%1", getPlayerUID _x]; [_Profile, "playerData", "position", position _x] call iniDB_write; [_Profile, "playerData", "Playername", name _x] call iniDB_write; [_Profile, "playerData", "magazines", magazines _x] call iniDB_write; [_Profile, "playerData", "score", score _x] call iniDB_write; }; } forEach allUnits; } }; Also big thanks for giving all this help SicSemperTyrannis, even if im a potato when it comes to this kind of coding, more of local builder :/
  7. hmm.. I got the playerinit.sqf as if(!isServer) exitWith {}; _unit = _this; _Profile = format["%1", getPlayerUID _unit]; _unit = [_Profile,"playerdata", "position", "ARRAY"] call iniDB_read; <<<< just realised that.. FML _unit = [_Profile,"playerdata", "position", "ARRAY"] call iniDB_read; <<<< just realised that.. FML - diden't help :/ _unit setpos (_Pos); _unit setscore (_Score); and initlize on unit as nil=[] execVM "playerinit.sqf"; yet dosent work, Am i doign something extreamly wrong?
  8. Diden't work out, How would i execute it so it loads? It works for me but not someone on my server, Their save file works but not load
  9. thing is, it shoud only load once they connect not on respawn and trying to get it work on JIP players, as on our server if death evrythings gone, Levels etc,
  10. My init file was missing the preprocess... alltime, God i am a potato ---------- Post added at 14:33 ---------- Previous post was at 13:11 ---------- Right saving is now working, but how do i cause the server to give player their profile as they connect?
  11. and how would i exev the serversavedata? Just Exev within init.sql or anything specific?
  12. What i ment is more that "loop" each 10th second to save on server with auto save, I'm not fully into coding so my way of speaking may sound invalid :p
  13. God.. i cant figure out how to get this running non-local, What does the init file need to make clients auto save and then that it just loads the array on spawn
  14. Alrighty, im just unsure wich one of your last quotes goes where and how to call it to do something, But thanks for replying :) ---------- Post added at 20:10 ---------- Previous post was at 19:49 ---------- Alrighty, im just unsure wich one of your last quotes goes where and how to call it to do something, But thanks for replying :) So i'll be having 1 sqf wich is clientsavedata.sqf wich simply does player setVariable["triggerSave", true, true]; wich then shoud call upon the serversave.sqf that is if(!isServer) exitWith {}; { if((_x getVariable["triggerSave", false])) then { diag_log format["%1", (["Stats", getPlayerUID _x, "position", position _x] call iniDB_write)]; }; } forEach allUnits; and init does execVM "serversavedata.sqf"; execVM "clientsavedata.sqf"; and it would be called by something settings the value of varible to 0? Hmm.. start making sense unless im completly wrong
  15. Could i possible Get in contact with you over steam or such for assistance? Its still not extreamly clear for me, Will send you a PM with my steam
×