mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-05-05 11:29:33 +03:00
Add optional args to register_plugin native (url, description)
This commit is contained in:
parent
7701c313e0
commit
865e020d78
@ -1396,14 +1396,16 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */
|
|||||||
return 1;
|
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);
|
CPluginMngr::CPlugin* a = g_plugins.findPluginFast(amx);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
char *title = get_amxstring(amx, params[1], 0, i);
|
const char *title = get_amxstring(amx, params[1], 0, i);
|
||||||
char *vers = get_amxstring(amx, params[2], 1, i);
|
const char *vers = get_amxstring(amx, params[2], 1, i);
|
||||||
char *author = get_amxstring(amx, params[3], 2, 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
|
#if defined BINLOG_ENABLED
|
||||||
g_BinLog.WriteOp(BinLog_Registered, a->getId(), title, vers);
|
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->setTitle(title);
|
||||||
a->setVersion(vers);
|
a->setVersion(vers);
|
||||||
a->setAuthor(author);
|
a->setAuthor(author);
|
||||||
|
a->setUrl(url);
|
||||||
|
a->setDescription(description);
|
||||||
|
|
||||||
/* Check if we need to add fail counters */
|
/* Check if we need to add fail counters */
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -243,10 +243,12 @@ forward client_putinserver(id);
|
|||||||
* @param plugin_name Name of the plugin
|
* @param plugin_name Name of the plugin
|
||||||
* @param version Version of the plugin
|
* @param version Version of the plugin
|
||||||
* @param author Author 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
|
* @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.
|
* Precaches a model file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user