Add elog_message native (#451)

* elog_message

Like "log_message". Logs a message to the current server log file, however the messages sent are also sent to all plugins and can be hooked using "register_logevent".

* Update amxmodx.cpp

* Update Editor.sci

* Update UnitfrmMain.dfm
This commit is contained in:
PartialCloning
2017-08-01 06:14:53 -07:00
committed by Vincent Herbet
parent 1dc1f1b9c4
commit 24e56d0476
4 changed files with 29 additions and 1 deletions

View File

@ -2011,6 +2011,19 @@ static cell AMX_NATIVE_CALL log_message(AMX *amx, cell *params) /* 1 param */
return len;
}
static cell AMX_NATIVE_CALL elog_message(AMX *amx, cell *params) /* 1 param */
{
int len;
g_langMngr.SetDefLang(LANG_SERVER);
char* message = format_amxstring(amx, params, 1, len);
message[len++] = '\n';
message[len] = 0;
g_pEngTable->pfnAlertMessage(at_logged, "%s", message);
return len;
}
static cell AMX_NATIVE_CALL log_to_file(AMX *amx, cell *params) /* 1 param */
{
int ilen;
@ -4782,6 +4795,7 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
{"lang_exists", lang_exists},
{"log_amx", log_amx},
{"log_message", log_message},
{"elog_message", elog_message},
{"log_to_file", log_to_file},
{"md5", amx_md5},
{"md5_file", amx_md5_file},