From 865e020d785ae857c84924e1d857518a12097743 Mon Sep 17 00:00:00 2001 From: KaidoRen Date: Thu, 9 May 2019 14:23:03 +0500 Subject: [PATCH] Add optional args to register_plugin native (url, description) --- amxmodx/amxmodx.cpp | 12 ++++++++---- plugins/include/amxmodx.inc | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index c06eafe1..7b21d36e 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -1396,14 +1396,16 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */ return 1; } -static cell AMX_NATIVE_CALL register_plugin(AMX *amx, cell *params) /* 3 param */ +static cell AMX_NATIVE_CALL register_plugin(AMX *amx, cell *params) /* 5 param */ { CPluginMngr::CPlugin* a = g_plugins.findPluginFast(amx); int i; - char *title = get_amxstring(amx, params[1], 0, i); - char *vers = get_amxstring(amx, params[2], 1, i); - char *author = get_amxstring(amx, params[3], 2, i); + const char *title = get_amxstring(amx, params[1], 0, i); + const char *vers = get_amxstring(amx, params[2], 1, i); + const char *author = get_amxstring(amx, params[3], 2, i); + const char *url = get_amxstring(amx, params[4], 3, i); + const char *description = get_amxstring(amx, params[5], 4, i); #if defined BINLOG_ENABLED g_BinLog.WriteOp(BinLog_Registered, a->getId(), title, vers); @@ -1412,6 +1414,8 @@ static cell AMX_NATIVE_CALL register_plugin(AMX *amx, cell *params) /* 3 param * a->setTitle(title); a->setVersion(vers); a->setAuthor(author); + a->setUrl(url); + a->setDescription(description); /* Check if we need to add fail counters */ i = 0; diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 2d734802..5187c529 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -243,10 +243,12 @@ forward client_putinserver(id); * @param plugin_name Name of the plugin * @param version Version of the plugin * @param author Author of the plugin + * @param url URL of the plugin + * @param description Description of plugin * * @return Plugin id of the calling plugin */ -native register_plugin(const plugin_name[], const version[], const author[]); +native register_plugin(const plugin_name[], const version[], const author[], const url[] = "", const description[] = ""); /** * Precaches a model file.