Added death messages.

This commit is contained in:
Julian
2020-06-01 03:53:42 -03:00
parent b4ec347170
commit 5c275e5b62
2 changed files with 458 additions and 39 deletions

View File

@@ -40,23 +40,24 @@
#include "sdk_util.h" // UTIL_LogPrintf, etc
// Must provide at least one of these..
static META_FUNCTIONS gMetaFunctionTable = {
NULL, // pfnGetEntityAPI HL SDK; called before game DLL
NULL, // pfnGetEntityAPI_Post META; called after game DLL
GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL
GetEntityAPI2_Post, // pfnGetEntityAPI2_Post META; called after game DLL
NULL, // pfnGetNewDLLFunctions HL SDK2; called before game DLL
NULL, // pfnGetNewDLLFunctions_Post META; called after game DLL
NULL, // pfnGetEngineFunctions META; called before HL engine
NULL, // pfnGetEngineFunctions_Post META; called after HL engine
static META_FUNCTIONS gMetaFunctionTable =
{
NULL, // pfnGetEntityAPI HL SDK; called before game DLL
NULL, // pfnGetEntityAPI_Post META; called after game DLL
GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL
GetEntityAPI2_Post, // pfnGetEntityAPI2_Post META; called after game DLL
NULL, // pfnGetNewDLLFunctions HL SDK2; called before game DLL
NULL, // pfnGetNewDLLFunctions_Post META; called after game DLL
NULL, // pfnGetEngineFunctions META; called before HL engine
GetEngineFunctions_Post, // pfnGetEngineFunctions_Post META; called after HL engine
};
// Description of plugin
plugin_info_t Plugin_info = {
META_INTERFACE_VERSION, // interface version
"MonsterMod", // name
"1.0", // version
"17/03/2020", // date in DD/MM/YYYY format
"2-prerelease", // version
"18/03/2020", // date in DD/MM/YYYY format
"botman, Rick90, Giegue", // original authors + recreation by...
"https://github.com/JulianR0/monstermod-redo", // url
"MONSTER", // logtag
@@ -77,10 +78,13 @@ meta_globals_t *gpMetaGlobals; // metamod globals
gamedll_funcs_t *gpGamedllFuncs; // gameDLL function tables
mutil_funcs_t *gpMetaUtilFuncs; // metamod utility functions
// CVars
cvar_t init_dllapi_log = {"monster_log", "0", FCVAR_EXTDLL, 0, NULL};
cvar_t *dllapi_log = NULL;
cvar_t init_monster_spawn = {"monster_spawn", "1", FCVAR_EXTDLL, 0, NULL};
cvar_t *monster_spawn = NULL;
cvar_t init_monster_show_deaths = {"monster_show_deaths", "1", FCVAR_EXTDLL, 0, NULL};
cvar_t *monster_show_deaths = NULL;
// Metamod requesting info about this plugin:
@@ -103,37 +107,41 @@ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo,
// pFunctionTable (requested) table of function tables this plugin catches
// pMGlobals (given) global vars from metamod
// pGamedllFuncs (given) copy of function tables from game dll
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable,
meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs)
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs)
{
if(now); // to satisfy gcc -Wunused
if(!pMGlobals) {
LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals");
return(FALSE);
}
gpMetaGlobals=pMGlobals;
if(!pFunctionTable) {
LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable");
return(FALSE);
}
memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
gpGamedllFuncs=pGamedllFuncs;
if(now); // to satisfy gcc -Wunused
if(!pMGlobals)
{
LOG_ERROR(PLID, "Meta_Attach called with null pMGlobals");
return(FALSE);
}
gpMetaGlobals=pMGlobals;
if(!pFunctionTable)
{
LOG_ERROR(PLID, "Meta_Attach called with null pFunctionTable");
return(FALSE);
}
memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
gpGamedllFuncs=pGamedllFuncs;
LOG_MESSAGE(PLID, "%s %s, %s", VNAME, VVERSION, VDATE);
LOG_MESSAGE(PLID, "by %s", VAUTHOR);
LOG_MESSAGE(PLID, "%s", VURL);
LOG_MESSAGE(PLID, "compiled: %s CDT", COMPILE_TIME);
LOG_MESSAGE(PLID, "%s %s, %s", VNAME, VVERSION, VDATE);
LOG_MESSAGE(PLID, "by %s", VAUTHOR);
LOG_MESSAGE(PLID, "%s", VURL);
LOG_MESSAGE(PLID, "compiled: %s CDT", COMPILE_TIME);
LOG_CONSOLE(PLID, "[%s] %s v%s, %s", VLOGTAG, VNAME, VVERSION, VDATE);
LOG_CONSOLE(PLID, "[%s] by %s", VLOGTAG, VAUTHOR);
LOG_CONSOLE(PLID, "[%s] %s v%s, %s", VLOGTAG, VNAME, VVERSION, VDATE);
LOG_CONSOLE(PLID, "[%s] by %s", VLOGTAG, VAUTHOR);
CVAR_REGISTER(&init_dllapi_log);
dllapi_log = CVAR_GET_POINTER("monster_log");
CVAR_REGISTER(&init_dllapi_log);
dllapi_log = CVAR_GET_POINTER("monster_log");
CVAR_REGISTER(&init_monster_spawn);
monster_spawn = CVAR_GET_POINTER("monster_spawn");
return(TRUE);
CVAR_REGISTER(&init_monster_spawn);
monster_spawn = CVAR_GET_POINTER("monster_spawn");
CVAR_REGISTER(&init_monster_show_deaths);
monster_show_deaths = CVAR_GET_POINTER("monster_show_deaths");
return(TRUE);
}