Added ClientPrintf engine function (request at30137)

This commit is contained in:
Scott Ehlert
2006-05-23 03:26:26 +00:00
parent 7e36a19590
commit ac1e3a9001
7 changed files with 37 additions and 4 deletions

View File

@ -638,6 +638,18 @@ char *GetInfoKeyBuffer_post(edict_t *e)
RETURN_META_VALUE(MRES_IGNORED, reinterpret_cast<char *>(mlCellResult));
}
void ClientPrintf(edict_t* pEdict, PRINT_TYPE ptype, const char *szMsg)
{
FM_ENG_HANDLE(FM_ClientPrintf, (Engine[FM_ClientPrintf].at(i), (cell)ENTINDEX(pEdict), (cell)ptype, szMsg));
RETURN_META(mswi(lastFmRes));
}
void ClientPrintf_post(edict_t* pEdict, PRINT_TYPE ptype, const char *szMsg)
{
FM_ENG_HANDLE(FM_ClientPrintf, (Engine[FM_ClientPrintf].at(i), (cell)ENTINDEX(pEdict), (cell)ptype, szMsg));
RETURN_META(MRES_IGNORED);
}
/*
* Beginning of Engine->Game DLL hooks
*/
@ -1455,6 +1467,10 @@ static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params)
fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_DONE);
ENGHOOK(GetInfoKeyBuffer);
break;
case FM_ClientPrintf:
fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_CELL, FP_STRING, FP_DONE);
ENGHOOK(ClientPrintf);
break;
#if 0
// I know this does not fit with DLLFUNC(), but I dont want another native just for it.