Skip to content

Commit

Permalink
Added AMXX and ReAPI version checker for compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
FEDERICOMB96 committed Feb 22, 2024
1 parent 5b3bb17 commit ea19831
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 14 deletions.
8 changes: 1 addition & 7 deletions addons/amxmodx/scripting/include/mm_incs/defines.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
#endif
#define _mm_defines_included_

#define PLUGIN_NAME "MultiMod Manager"

#define MM_VERSION_MAJOR 2
#define MM_VERSION_MINOR 2
#define MM_VERSION_COMMIT 206

#define PLUGIN_VERSION fmt("v%d.%d.%d", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_COMMIT)
#define PLUGIN_NAME "MultiMod Manager CS"
#define PLUGIN_URL "https://github.com/FEDERICOMB96/amxx-multimod-manager"

#define MM_PLUGINS_FILENAME "plugins-multimodmanager.ini"
Expand Down
26 changes: 26 additions & 0 deletions addons/amxmodx/scripting/include/mm_incs/version.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#if defined _mm_version_included_
#endinput
#endif
#define _mm_version_included_

// Do NOT modify this file!

/**
* AMX Mod X version check
*/
#if AMXX_VERSION_NUM < 200
#error "Multimod Manager CS requires AMX Mod X 1.10 or higher. Download from: https://www.amxmodx.org/downloads-new.php?branch=master"
#endif

/**
* ReAPI version check
*/
#if REAPI_VERSION < 524300
#error "Multimod Manager CS requires ReAPI 5.24.300 or higher. Download from: https://github.com/s1lentq/reapi/releases/latest"
#endif

#define MM_VERSION_MAJOR 2
#define MM_VERSION_MINOR 2
#define MM_VERSION_COMMIT 207

#define PLUGIN_VERSION fmt("v%d.%d.%d", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_COMMIT)
14 changes: 7 additions & 7 deletions addons/amxmodx/scripting/include/multimod_manager_natives.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#endif
#define _multimod_manager_natives_included_

#include <multimod_manager_version>

/**
* Multimod Manager version check.
* Do not modify this!
* MultiMod Manager CS library check
*/
#define MM_VERSION_MAJOR 2
#define MM_VERSION_MINOR 2
#define MM_VERSION_COMMIT 206

#define MM_NATIVES_API_VER fmt("v%d.%d.%d", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_COMMIT)
#pragma reqlib MultiModManagerCS
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib MultiModManagerCS
#endif

enum ChangeMap_e
{
Expand Down
23 changes: 23 additions & 0 deletions addons/amxmodx/scripting/include/multimod_manager_version.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#if defined _multimod_manager_version_included_
#endinput
#endif
#define _multimod_manager_version_included_

// Do NOT modify this file!

/**
* AMX Mod X version check
*/
#if defined AMXX_VERSION_NUM
#if AMXX_VERSION_NUM < 200
#error "[API] Multimod Manager CS requires AMX Mod X 1.10 or higher. Download from: https://www.amxmodx.org/downloads-new.php?branch=master"
#endif
#else
#error "[API] Multimod Manager CS: please include multimod_manager_natives.inc after including amxmodx.inc."
#endif

#define MM_VERSION_MAJOR 2
#define MM_VERSION_MINOR 2
#define MM_VERSION_COMMIT 207

#define MM_NATIVES_API_VER fmt("v%d.%d.%d", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_COMMIT)
3 changes: 3 additions & 0 deletions addons/amxmodx/scripting/multimod_manager.sma
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <amxmisc>
#include <reapi>
#include <json>
#include "mm_incs/version"
#include "mm_incs/defines"
#include "mm_incs/global"
#include "mm_incs/natives"
Expand All @@ -18,6 +19,8 @@

public plugin_natives()
{
register_library("MultiModManagerCS");

register_native("mm_get_mods_count", "_mm_get_mods_count");
register_native("mm_is_mod_enabled", "_mm_is_mod_enabled");
register_native("mm_get_mod_name", "_mm_get_mod_name");
Expand Down

0 comments on commit ea19831

Please sign in to comment.