request at29928

New callable engine function: AlertMessage
This commit is contained in:
Scott Ehlert
2006-05-19 06:01:55 +00:00
parent e0bed163ac
commit b40f5e6637
5 changed files with 24 additions and 5 deletions

View File

@ -52,7 +52,7 @@ enum
DLLFunc_pfnAllowLagCompensation, // int ) ( void );
// I know this does not fit with DLLFUNC(), but I don't want another native just for it.
MetaFunc_CallGameEntity, // bool ) (plid_t plid, const char *entStr,entvars_t *pev);
DLLFunc_ClientUserInfoChanged, // void ) (idplayer)
DLLFunc_ClientUserInfoChanged, // void ) (edict *pEntity, char *infobuffer);
// You can pass in 0 for global client data handle or another client data handle here
DLLFunc_UpdateClientData, // void ) (const struct edict_s *ent, int sendweapons, struct clientdata_s *cd);
// You can pass in 0 for global entity state handle or another entity state handle here

View File

@ -1054,6 +1054,13 @@ static cell AMX_NATIVE_CALL engfunc(AMX *amx, cell *params)
temp = (*g_engfuncs.pfnGetInfoKeyBuffer)((index == -1) ? NULL : INDEXENT2(index));
return reinterpret_cast<cell>(temp);
case EngFunc_AlertMessage: // void ) (ALERT_TYPE atype, char *szFmt, ...);
cRet = MF_GetAmxAddr(amx, params[2]);
iparam1 = cRet[0];
temp = MF_FormatAmxString(amx, params, 3, &len);
(*g_engfuncs.pfnAlertMessage)(static_cast<ALERT_TYPE>(iparam1), temp);
return 1;
default:
MF_LogError(amx, AMX_ERR_NATIVE, "Unknown engfunc type %d", type);
return 0;

View File

@ -79,7 +79,8 @@ enum {
EngFunc_SetKeyValue, // void ) (char *infobuffer, char *key, char *value);
EngFunc_SetClientKeyValue, // void ) (int clientIndex, char *infobuffer, char *key, char *value);
EngFunc_CreateInstancedBaseline, // int ) (int classname, struct entity_state_s *baseline);
EngFunc_GetInfoKeyBuffer // char*) (edict_t *e);
EngFunc_GetInfoKeyBuffer, // char*) (edict_t *e);
EngFunc_AlertMessage // void ) (ALERT_TYPE atype, char *szFmt, ...);
};
#endif //_ENGFUNC_INCLUDE_H