diff --git a/dlls/engine/amxxapi.cpp b/dlls/engine/amxxapi.cpp index de1a6005..72151d49 100755 --- a/dlls/engine/amxxapi.cpp +++ b/dlls/engine/amxxapi.cpp @@ -35,6 +35,7 @@ void OnAmxxAttach() PlayerPostThinkForward = 0; ClientKillForward = 0; ClientImpulseForward = 0; + CmdStartForward = 0; StartFrameForward = 0; MF_AddNatives(ent_Natives); MF_AddNewNatives(ent_NewNatives); @@ -55,6 +56,7 @@ void OnPluginsLoaded() PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE); // done ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE); // done ClientImpulseForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE); // done + CmdStartForward = MF_RegisterForward("client_cmdStart", ET_STOP, FP_CELL, FP_DONE); // done StartFrameForward = MF_RegisterForward("server_frame", ET_IGNORE, FP_DONE); // done DispatchKeyForward = MF_RegisterForward("pfn_keyvalue", ET_STOP, FP_CELL, FP_DONE); // done PlaybackForward = MF_RegisterForward("pfn_playbackevent", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); // done @@ -92,8 +94,8 @@ void OnPluginsLoaded() if (CheckForPublic("client_kill")) g_pFunctionTable->pfnClientKill=ClientKill; - g_pFunctionTable->pfnCmdStart=NULL; // "client_impulse","register_impulse" - if (CheckForPublic("client_impulse")) + g_pFunctionTable->pfnCmdStart=NULL; // "client_impulse","register_impulse","client_cmdStart" + if (CheckForPublic("client_impulse") || CheckForPublic("client_cmdStart")) g_pFunctionTable->pfnCmdStart=CmdStart; g_pFunctionTable->pfnThink=NULL; // "pfn_think", "register_think" diff --git a/dlls/engine/engine.h b/dlls/engine/engine.h index 52126b43..ed0b879a 100755 --- a/dlls/engine/engine.h +++ b/dlls/engine/engine.h @@ -28,6 +28,7 @@ extern int PlayerPreThinkForward; extern int PlayerPostThinkForward; extern int ClientKillForward; extern int ClientImpulseForward; +extern int CmdStartForward; extern int StartFrameForward; extern int DispatchUseForward; extern int VexdTouchForward; diff --git a/dlls/engine/forwards.cpp b/dlls/engine/forwards.cpp index 89874d7c..ae0b0e36 100755 --- a/dlls/engine/forwards.cpp +++ b/dlls/engine/forwards.cpp @@ -11,6 +11,7 @@ int PlayerPreThinkForward = 0; int PlayerPostThinkForward = 0; int ClientKillForward = 0; int ClientImpulseForward = 0; +int CmdStartForward = 0; int StartFrameForward = 0; int VexdTouchForward = 0; int VexdServerForward = 0; @@ -124,7 +125,6 @@ void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int int retVal = 0; edict_t *pEntity = (edict_t *)player; g_cmd = (struct usercmd_s *)_cmd; - META_RES res = MRES_IGNORED; int origImpulse = g_cmd->impulse; // incase a plugin alters it for (i=0; iimpulse = 0; } + // client_CmdStart + if (CmdStartForward != -1) + { + incmd = true; + retVal = MF_ExecuteForward(CmdStartForward, (cell)ENTINDEX(pEntity)); + incmd = false; + + if (retVal) + RETURN_META(MRES_SUPERCEDE); + } + RETURN_META(MRES_IGNORED); } diff --git a/plugins/include/engine.inc b/plugins/include/engine.inc index e9a50e2e..a91d22dc 100755 --- a/plugins/include/engine.inc +++ b/plugins/include/engine.inc @@ -207,6 +207,9 @@ forward client_PostThink(id); /* Forward for impulses. */ forward client_impulse(id, impulse); +/* Forward for CmdStart() on a player. */ +forward client_cmdStart(id); + /* Called when an entity "thinks" (DispatchThink) */ forward pfn_think(entid);