Jump to content

[Tutorial] AutoSave Script


IceEagle132
 Share

Recommended Posts

Author: Leon "DerL30N" Beeser"

features:

  • Individually Adjustable, relaxing in a Master.hpp, in the following areas:
    1. Any adjustment of the automatic save interval, the minimum is two minutes.
      (But I do not recommend less than 10 or 15 minutes to go)
    2. Locking the manual save, after every Autosave
    3. Duration of locking the manual storage, ie the time that the player after a "AutoSave" can not save manually.
      Only possible if the function of locking the manual save is enabled.
    4. Disabling and enabling a short; Or informative "Auto store information" in the system chat.
      (System Chat = Where you always see the BattleEye news, or see if a player enters the server or leaves)
    5. Intelligent saving: If a player manually his datastores / syncing, so waiting the script is completed by this operation AND also waiting for 5 minutes until it returns to work. This feature is designed to protect traffic.
      The 5 minutes arising from the time that must wait the skewer, until he, manually save, the next time, save for a manual.


Important information :

  • Developed in version 4.4r3 (Therefore, I recommend to test it once on lower versions. This does not remove the circumstances, there is no Life files are modified, except an entry in the init.sqf and descriptin.ext)
  • An estimated compatible to version 4.0 (Please order tests and especially feedback)

Please In attachment there are screenshots and the script followed, the installation HERE IN THE FORUM under installation.

 

installation:

  1. Add the following code below  #include "config\Config_Master.hpp" inside description.ext

 

#include "derleon\Scripts_Master.hpp"

In Functions.hpp add:

 class autosave
 {
   file = "derleon\autosave";
   class autoSaveInv {};
 };

Inside Altis_Life.Altis \ core \ init.sqf

Add the following code at the end:

[] spawn life_fnc_autoSaveInv;

Copy the downloaded folder named derleon from AutoSave_Scrip.zip

And put it inside of Altis_Life.Altis

  • Like 4
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 3 weeks later...
  • 3 weeks later...
  • 1 month later...
4 minutes ago, nagato said:

does it fix when player die they alt+f4 and login they dont lost gear  ?

This removes thier gear when they die btw or meant to when used with onplayerkilled., so keep that in mind, I had it in my onplayerkilled at one point, which would delete the gear as soon as they were killed, you could try an eventhandler for onClientDisconnect or something like that but I don't know how effective it would be.


//Remove all Gear while dead (Combat Logging) 
	if(playerSide == civilian) then {
		
		//Capture what they are wearing so we can restore it later
		dead_outfit = uniform player;
		dead_outfit_items = uniformItems player;
		dead_vest = vest player;
		dead_vest_items = vestItems player;
		dead_headgear = headGear player;
		dead_goggles = goggles player;
		dead_backpack = backpack player;
		dead_backpack_items = backpackItems player;
		
		dead_primaryweapon = primaryWeapon player;
		dead_primaryweapon_items = primaryWeaponItems player;

		dead_secondaryweapon = secondaryWeapon player;
		dead_secondaryweapon_items = secondaryWeaponItems player;

		dead_handgun = handgunWeapon player;
		dead_handgun_items = handgunItems player;
		
		//Remove Everything
		
		player removeWeapon (primaryWeapon player);
		player removeWeapon (handGunWeapon player);
		
		player forceAddUniform dead_outfit; //Add uniform back on
		
		[] call SOCK_fnc_updateRequest;
	};

 

Link to comment
Share on other sites

  • 3 months later...
On 2016. 9. 14. at 6:10 PM, IceEagle132 said:

Author : Leon " DerL30N"Beeser "

풍모:

  • 개별적으로 조정할 수 있으며 다음 영역에서 Master.hpp에서 휴식을 취하십시오.
    1. 자동 저장 간격의 조정은 최소 2 분입니다.
      (하지만 10 분에서 15 분 정도는지나 가지 않는 것이 좋습니다.)
    2. 매 수동 저장 후 수동 저장 잠금
    3. 수동 저장 장치 잠금 시간, 즉 "자동 저장"이후에 플레이어가 수동으로 저장할 수없는 시간.
      수동 저장을 잠글 수있는 기능이 활성화 된 경우에만 가능합니다.
    4. 단락을 비활성화하고 활성화합니다. 또는 시스템 채팅에 유익한 "자동 저장 정보". (시스템 채팅 = BattleEye 뉴스를 항상 보거나 플레이어가 서버에 들어가거나 떠나는지 확인하십시오)
    5. 지능형 저장 : 플레이어가 수동으로 자신의 데이터 저장소 / 동기화, 그래서 스크립트를 기다리는 것은이 작업에 의해 완료되고 그것이 작동하기까지 5 분 동안 기다립니다. 이 기능은 트래픽을 보호하기 위해 설계되었습니다. 꼬챙이를 기다려야하는 시간에서부터 5 분이 경과 할 때까지 다음 시간을 수동으로 저장할 때까지 수동으로 저장하십시오.


중요한 정보 :

  • 버전 4.4r3에서 개발되었습니다 (따라서 하위 버전에서는 한 번 테스트해볼 것을 권장합니다.) 상황을 제거하지 않고 init.sqf 및 descriptin.ext의 항목을 제외하고 Life 파일이 수정되지 않습니다.
  • 버전 4.0과 호환되는 것으로 추정됩니다 (테스트 및 특히 피드백을 주문하십시오)

첨부 파일에는 스크린 샷과 스크립트가 있으며, 여기서는 설치 포럼에 설치됩니다.

 

설치 : 1. 아래 코드를 추가하십시오

    #include "config\Config_Master.hpp" inside description.ext

 

에서 Functions.hpp 추가 :

Altis_Life.Altis \ core \ init.sqf 내부

끝에 다음 코드를 추가하십시오.

다운로드 한 폴더를 derleon에서 복사하십시오.AutoSave_Scrip.zip

Altis_Life.Altis 안에 넣어 주세요.

How to change the time?

Link to comment
Share on other sites

  • 2 weeks later...

You guys saved me once again! Thanks @IceEagle132 for this tut!

It works on v5.0.

Just change the language.

in missionfile.Altis\derleon\autosave\fn_autoSaveInv.sqf change 

Deine Daten wurden automatisch gespeichert. Manuelles Speichern für %1 min. gesperrt.

to

Your data has been saved automatically. Manual storage for %1 min has been blocked.

and then look for,

Deine Daten wurden automatisch gespeichert.

change to

Your data has been saved automatically.

Thats all I could see.  

It is perfect as is, besides the language. This will stop the "Where did my gear go?" All of you guys are very impressive. This site is invaluable, Thanks again.

Link to comment
Share on other sites

On 6/10/2017 at 1:10 PM, lina said:

How to change the time?

@lina

In 

missionfile.Altis\derleon\Scripts_Master.hpp  Look for,

autosaveInterval = 15; // Automatic saving intervall in minutes default [15]

The first 15 is the time in minutes for the auto save interval. 

 

Link to comment
Share on other sites

On 18.02.2017 at 10:55 AM, Repentz said:

This removes thier gear when they die btw or meant to when used with onplayerkilled., so keep that in mind, I had it in my onplayerkilled at one point, which would delete the gear as soon as they were killed, you could try an eventhandler for onClientDisconnect or something like that but I don't know how effective it would be.


//Remove all Gear while dead (Combat Logging) 
	if(playerSide == civilian) then {
		
		//Capture what they are wearing so we can restore it later
		dead_outfit = uniform player;
		dead_outfit_items = uniformItems player;
		dead_vest = vest player;
		dead_vest_items = vestItems player;
		dead_headgear = headGear player;
		dead_goggles = goggles player;
		dead_backpack = backpack player;
		dead_backpack_items = backpackItems player;
		
		dead_primaryweapon = primaryWeapon player;
		dead_primaryweapon_items = primaryWeaponItems player;

		dead_secondaryweapon = secondaryWeapon player;
		dead_secondaryweapon_items = secondaryWeaponItems player;

		dead_handgun = handgunWeapon player;
		dead_handgun_items = handgunItems player;
		
		//Remove Everything
		
		player removeWeapon (primaryWeapon player);
		player removeWeapon (handGunWeapon player);
		
		player forceAddUniform dead_outfit; //Add uniform back on
		
		[] call SOCK_fnc_updateRequest;
	};

 

thanx

Edited by Kadir_Sexy
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • 4 months later...
On 18/2/2017 at 8:55 AM, Repentz said:

This removes thier gear when they die btw or meant to when used with onplayerkilled., so keep that in mind, I had it in my onplayerkilled at one point, which would delete the gear as soon as they were killed, you could try an eventhandler for onClientDisconnect or something like that but I don't know how effective it would be.


//Remove all Gear while dead (Combat Logging) 
	if(playerSide == civilian) then {
		
		//Capture what they are wearing so we can restore it later
		dead_outfit = uniform player;
		dead_outfit_items = uniformItems player;
		dead_vest = vest player;
		dead_vest_items = vestItems player;
		dead_headgear = headGear player;
		dead_goggles = goggles player;
		dead_backpack = backpack player;
		dead_backpack_items = backpackItems player;
		
		dead_primaryweapon = primaryWeapon player;
		dead_primaryweapon_items = primaryWeaponItems player;

		dead_secondaryweapon = secondaryWeapon player;
		dead_secondaryweapon_items = secondaryWeaponItems player;

		dead_handgun = handgunWeapon player;
		dead_handgun_items = handgunItems player;
		
		//Remove Everything
		
		player removeWeapon (primaryWeapon player);
		player removeWeapon (handGunWeapon player);
		
		player forceAddUniform dead_outfit; //Add uniform back on
		
		[] call SOCK_fnc_updateRequest;
	};

 

in this way the player will be born dead , if he died and forced his exit (Alt+F4).
instead to be born alive only with the default clothes?

Link to comment
Share on other sites

We are talking about a method used to prevent the player after an alt F4 from being reborn with the same items! I asked how it could be avoided
A: that the player after a forced arrest reappears dying waiting for help !
B: that the player after a forced arrest reappears alive but without any items !

Link to comment
Share on other sites

4 hours ago, one said:

Il titolo dello script che hai citato dice "registrazione del combattimento". Questo è quello di cui stai parlando. Quello script dovrebbe essere quello che stai cercando. Potrebbe essere necessario modificarlo per adattarlo alle esigenze, ma è così. 

yes, but given that a script has been written about it, but that makes you reborn dead after an "alt + F4" I asked if someone had modified it so that it was born alive but without any item! answer only if you can help without adding unnecessary comments! thank you !!!!

 

Link to comment
Share on other sites

40 minutes ago, Yachos said:

yes, but given that a script has been written about it, but that makes you reborn dead after an "alt + F4" I asked if someone had modified it so that it was born alive but without any item! answer only if you can help without adding unnecessary comments! thank you !!!!

 

Well the problem is we don't understand your question as this is an English forum and our rules and majority of members Here speak English... 

Why dont you create a EventHandler and if they AltF4 remove their gear, add basics then sync it to database? 

Link to comment
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
Reply to this topic...

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

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.