From d179f008bfaef42be710f7f9831a2f8ebd8a5753 Mon Sep 17 00:00:00 2001 From: NRZ7 Date: Sat, 8 Oct 2016 14:55:39 +0200 Subject: [PATCH] First Release --- addons/modChecker/modChecker.paa | Bin 0 -> 22016 bytes addons/modChecker/modChecker.sqf | 99 ++++++++++++++++++++++++ addons/modChecker/modCheckerDisplay.sqf | 97 +++++++++++++++++++++++ config.cpp | 12 +++ initPlayerLocal.sqf | 29 +++++++ 5 files changed, 237 insertions(+) create mode 100644 addons/modChecker/modChecker.paa create mode 100644 addons/modChecker/modChecker.sqf create mode 100644 addons/modChecker/modCheckerDisplay.sqf create mode 100644 config.cpp create mode 100644 initPlayerLocal.sqf diff --git a/addons/modChecker/modChecker.paa b/addons/modChecker/modChecker.paa new file mode 100644 index 0000000000000000000000000000000000000000..544a39dadd7388793388c98429f560de883d9fc4 GIT binary patch literal 22016 zcmeG^3sh7`mi1^_z|cTeJE+|ZprB~NL{{h-1Ii;aB1EI@Ot&x!;g{ei;j{iuvMb?Z zew?GhWWpqxVM#JGesB`eXgf1z*B+eJWEYi*^vGuu-J_usO$0O;J<`6tx8AGAqp_tS z5Q*^};BmXEZrxk=-nzGLRkd1}J2%1fv$=~CJP9Gq&CQ_{PEB|eVF4b5=O)ZgM3{qL zgnyZsxR8hcOW^lK_~&IKA(bXVerqP=Ed09vlpqe?{rXNdBOWHiY&Jj7K9=A|7(CGT zU3_#rN6h#+%TJV#_7CiHZ;<~^53-WMM`sf9i^XQQRq!spku`oyj_fVUr&6|WJIL3^ zqi4cE`KOxPmp8UIo3(0&e+sns*-?_o;Jf(PNZkBA)Z^#ei)4?L>~oYyd083!6(59+ z1F-Kt^uo;Mpe@J zZe4q~4&@!F;nsI1RzoZo-`%$KbPYVqYcRA6PSD$R6s~L%t_ea#H-o1i-s`XmU4q^| z>R}U4$b70lWnridm#RrwPWw0*3a)NzS;F4Z%fWu zDxW~DI^twE$oFzElc(~kWVcG?8bK&7`>U{9I8tE8`VjW3 zr*)M&S`K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Checker/modChecker.sqf b/addons/modChecker/modChecker.sqf new file mode 100644 index 0000000..77a3be1 --- /dev/null +++ b/addons/modChecker/modChecker.sqf @@ -0,0 +1,99 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: modChecker.sqf +// @file Author: NRZ7 (www.standarol.com) +// @description: This script check the mods loaded by the client. If any mod is not loaded, pop's a screen with detailed information and clickable community links (modCheckerDisplay.sqf). +// You can configure requiered addons (error 99) or optional addons (error 1). If any required mod fails, the client load "You Loose" screen after close the dialog. +// + + +errorLevel = 0; + + +// Exile_Client Example +// Change "Exile_Client" to name of the Cfg patche from desired mod +if (isClass(configFile >> "CfgPatches" >> "Exile_Client")) then { +// Change checkExile to your desired mod variable name +// Change "Exile Mod is" to your mod string + checkExile = "Exile Mod is found!
"; + } else { +// Change "Exile Mod is" to your mod string + checkExile = "Exile Mod is NOT FOUND!
"; +// Set 99 to Required, Set 1 to optional + errorLevel = errorLevel + 99 + }; + +// Esseker Example +if (isClass(configFile >> "CfgPatches" >> "Esseker")) then { + checkEsseker = "Esseker Map is found!
"; + } else { + checkEsseker = "Esseker Map is NOT FOUND!
"; + errorLevel = errorLevel + 99 + }; + +// Zombis & Demonds Example +if (isClass(configFile >> "CfgPatches" >> "Ryanzombies")) then { + checkRyan = "Zombies and Demonds is found!
"; + } else { + checkRyan = "Zombies and Demonds is NOT FOUND!
"; + errorLevel = errorLevel + 99 + }; + +// CUP_Weapons Example +if (isClass(configFile >> "CfgPatches" >> "CUP_Weapons_WeaponsCore")) then { + checkWeapons = "CUP Weapons is found!
"; + } else { + checkWeapons = "CUP Weapons is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; + +// CUP_Vehicles Example +if (isClass(configFile >> "CfgPatches" >> "CUP_Vehicles_Core")) then { + checkVehicles = "CUP Vehicles is found!
"; + } else { + checkVehicles = "CUP Vehicles is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; + +// CUP_TerrainCore Example +if (isClass(configFile >> "CfgPatches" >> "CUP_Worlds")) then { + checkTerrain = "CUP Terrain Core is found!
"; + } else { + checkTerrain = "CUP Terrain Core is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; + +// CUP_Units Example +if (isClass(configFile >> "CfgPatches" >> "CUP_Creatures_People_Core")) then { + checkUnits = "CUP Units is found!
"; + } else { + checkUnits = "CUP Units is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; + +// Community Base Addon Example +if (isClass(configFile >> "CfgPatches" >> "CBA_main")) then + { + checkCBA = "CBA_A3 is found!
"; + } else { + checkCBA = "CBA_A3 is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; + +if (errorLevel > 0) then { + warnMessage = "Some is WRONG with your MODS
"; + } else { + warnMessage = "All MODS are FINE
"; + }; + +if ((errorLevel == 0) && (firstCheck == 0)) then { + firstCheck = 1 // Do nothing + } else { + execVM "addons\modChecker\modCheckerDisplay.sqf" + }; + +// execVM "addons\modChecker\modCheckerDisplay.sqf" + + diff --git a/addons/modChecker/modCheckerDisplay.sqf b/addons/modChecker/modCheckerDisplay.sqf new file mode 100644 index 0000000..cfa8700 --- /dev/null +++ b/addons/modChecker/modCheckerDisplay.sqf @@ -0,0 +1,97 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: modCheckerDisplay.sqf +// @file Author: NRZ7 (www.standarol.com) +// @description: This script is a UI launched by modchecker.sqf. If any mod is not loaded, pop's a screen with detailed information and clickable community links (modCheckerDisplay.sqf). +// You can configure custom messages and links to your community guides. + +/* + Some code is from + File: rules.sqf + For exile edited by Repentz + Link: http://www.exilemod.com/topic/10375-advanced-server-rules-for-xm8/ +*/ + +if ((firstCheck == 0) && (errorLevel > 0)) then { player allowdamage false }; // God Mode ON to avoid die and close dialog only if ModCheckerDisplay is auto opened. + +disableSerialization; +[ + "", + 0, + 0.2, + 10, + 0, + 0, + 8 +] spawn BIS_fnc_dynamicText; + +createDialog "RscDisplayWelcome"; + +_display = findDisplay 999999; // 999999 needed to whitelist in infistar if you are using this. +_text1 = _display displayCtrl 1100; +_buttonSpoiler = _display displayctrl 2400; +_textSpoiler = _display displayctrl 1101; +_text2 = _display displayCtrl 1102; + +///////////////////////////////////////////////////////////////////////////////////////////// +// Remember to add-delete-modify the same mod variable names like modChecker.sqf +///////////////////////////////////////////////////////////////////////////////////////////// + +// Display header +_message = ""; +_message = _message + "
"; +_message = _message + "Welcome to Mod Checker
"; +_message = _message + "______________________________________________________________________________________

"; +_message = _message + warnMessage; +_message = _message + "
"; + +//Mod variable names +_message = _message + checkExile; +_message = _message + checkEsseker; +_message = _message + checkRyan; +_message = _message + checkWeapons; +_message = _message + checkVehicles; +_message = _message + checkUnits; +_message = _message + checkTerrain; +_message = _message + checkCBA; + +// Custom message with community links +_message = _message + "
"; +_message = _message + "If you get any error, please, read the following links

"; +_message = _message + "Download the mods from Steam Workshop Only click on Subscribe!
"; +_message = _message + "Guía de lanzamiento e instalación de mods [ESPAÑOL]


"; + +///////////////////////////////////////////////////////////////////////////////////////////////////// +// END OF CUSTOMIZABLE TEXT, DO NOT TOUCH UNDER THIS LINE IF YOU DON'T KWOW WHAT ARE YOU WANT +//////////////////////////////////////////////////////////////////////////////////////////////////// + +//Fill only the first text +_text1 ctrlSetStructuredText (parseText _message); + +//Resize StructuredText component to display the scrollbar if needed +_positionText1 = ctrlPosition _text1; +_yText1 = _positionText1 select 1; +_hText1 = ctrlTextHeight _text1; +_text1 ctrlSetPosition [_positionText1 select 0, _yText1, _positionText1 select 2, _hText1]; +_text1 ctrlcommit 0; +//Hide second text, spoiler text and button +_buttonSpoiler ctrlSetFade 1; +_buttonSpoiler ctrlCommit 0; +_buttonSpoiler ctrlEnable false; +_textSpoiler ctrlSetFade 1; +_textSpoiler ctrlCommit 0; +_text2 ctrlSetFade 1; +_text2 ctrlCommit 0; + +//Waith until dialog is closed and kick the player if a required mod is not loaded. +waitUntil {!dialog }; +if (errorLevel > 90) then // non requiered addons have level 1. Requiered addons have error level 99. + { + endMission "LOSER" + } + else + { + firstCheck = 1; player allowDamage true // Disables God Mode protection and set mods as checked. + }; \ No newline at end of file diff --git a/config.cpp b/config.cpp new file mode 100644 index 0000000..761f633 --- /dev/null +++ b/config.cpp @@ -0,0 +1,12 @@ +class CfgXM8 +{ + extraApps[] = {"modChecker"}; + + class modChecker + { + title = "Mod Checker"; + logo = "addons\modChecker\modChecker.paa"; + quickFunction = "[] execVM 'addons\modChecker\modChecker.sqf'"; + + }; +}; \ No newline at end of file diff --git a/initPlayerLocal.sqf b/initPlayerLocal.sqf new file mode 100644 index 0000000..227ade8 --- /dev/null +++ b/initPlayerLocal.sqf @@ -0,0 +1,29 @@ +// Add this at the bottom of initPlayerLocal.sqf + +/////////////////////////////////////////////////////////////////////////// +// MOD CHECKER +/////////////////////////////////////////////////////////////////////////// + +waitUntil {!isNull findDisplay 46 && !isNil 'ExileClientLoadedIn' && getPlayerUID player != ''}; // wait until player is in spawned +uiSleep 3; + +firstCheck = 0; +execVM "addons\modChecker\modChecker.sqf"; + +/////////////////////////////////////////////////////////////////////////// +// MOD CHECKER + PROTECTION REMEMBER +/////////////////////////////////////////////////////////////////////////// + +/*Note, if you have Exile ProtectionRemember.sqf, use this + +waitUntil {!isNull findDisplay 46 && !isNil 'ExileClientLoadedIn' && getPlayerUID player != ''}; // wait until player is in spawned +uiSleep 3; +execVM "addons\scripts\protectionRemember.sqf"; +/////////////////////////////////////////////////////////////////////////// +// MOD CHECKER +/////////////////////////////////////////////////////////////////////////// + +firstCheck = 0; +execVM "addons\modChecker\modChecker.sqf"; + +*/ \ No newline at end of file