Added AlertMessage to fakemeta

This commit is contained in:
David Anderson
2004-10-03 07:04:08 +00:00
parent ef90960121
commit f3cfd31668
5 changed files with 42 additions and 23 deletions

View File

@ -111,6 +111,28 @@ void TraceLine_post(const float *v1, const float *v2, int fNoMonsters, edict_t *
RETURN_META(MRES_IGNORED);
}
void AlertMessage(ALERT_TYPE atype, char *szFmt, ...)
{
static char buf[2048];
va_list ap;
va_start(ap, szFmt);
vsprintf(buf, szFmt, ap);
va_end(ap);
FM_ENG_HANDLE(FM_AlertMessage, (Engine[FM_AlertMessage].at(i), atype, buf));
RETURN_META(mswi(lastFmRes));
}
void AlertMessage_post(ALERT_TYPE atype, char *szFmt, ...)
{
static char buf[2048];
va_list ap;
va_start(ap, szFmt);
vsprintf(buf, szFmt, ap);
va_end(ap);
FM_ENG_HANDLE(FM_AlertMessage, (Engine[FM_AlertMessage].at(i), atype, buf));
RETURN_META(MRES_IGNORED);
}
// pfnModelIndex
SIMPLE_INT_HOOK_CONSTSTRING(ModelIndex);
@ -872,7 +894,10 @@ static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params)
ENGHOOK(IsMapValid);
break;
case FM_AlertMessage:
fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_STRING, FP_DONE);
ENGHOOK(AlertMessage);
break;
/*
* Begin of DLLFuncs

View File

@ -1,7 +1,7 @@
#ifndef _INCLUDE_FORWARD_H
#define _INCLUDE_FORWARD_H
#define ENGFUNC_NUM 108
#define ENGFUNC_NUM 118
#define FMV_STRING 1
#define FMV_FLOAT 2
@ -148,6 +148,7 @@ enum {
// Create baselines for certain "unplaced" items.
FM_CreateInstancedBaselines, // done
FM_AllowLagCompensation, // done
FM_AlertMessage,
};
extern CVector<int> Engine[];