diff --git a/plugins/callback_declarations.h b/plugins/callback_declarations.h index 56ac0a7f..3006132d 100644 --- a/plugins/callback_declarations.h +++ b/plugins/callback_declarations.h @@ -49,6 +49,7 @@ PCL void OnClientSpawn(gentity_t* ent); PCL void OnClientEnterWorld(client_t* client); PCL void OnClientUserinfoChanged(client_t* client); + PCL void OnClientCommand(client_t* client, const char* command); PCL void OnClientMoveCommand(client_t* client, usercmd_t* ucmd); PCL void OnPlayerKilled(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, int damage, int meansOfDeath, int iWeapon, hitLocation_t hitLocation); PCL void OnPlayerWantReservedSlot(netadr_t* from, char* pbguid, char* userinfo, int authstate, qboolean *isallowed); diff --git a/src/plugin_events.h b/src/plugin_events.h index fdb051c0..9db7ec4a 100644 --- a/src/plugin_events.h +++ b/src/plugin_events.h @@ -50,6 +50,7 @@ enum PluginEvents{ PLUGINS_ONPREGAMERESTART, PLUGINS_ONPOSTGAMERESTART, PLUGINS_ONCLIENTUSERINFOCHANGED, + PLUGINS_ONCLIENTCOMMAND, PLUGINS_ONCLIENTMOVECOMMAND, PLUGINS_ONPLAYERKILLED, PLUGINS_ONPLAYERWANTRESERVEDSLOT, diff --git a/src/plugin_handler.c b/src/plugin_handler.c index 98e3ff4a..0846f028 100644 --- a/src/plugin_handler.c +++ b/src/plugin_handler.c @@ -65,6 +65,7 @@ char PHandler_Events[PLUGINS_ITEMCOUNT][32]={ "OnPreGameRestart", "OnPostGameRestart", "OnClientUserinfoChanged", + "OnClientCommand", "OnClientMoveCommand", "OnPlayerKilled", "OnPlayerWantReservedSlot", diff --git a/src/sv_client.c b/src/sv_client.c index a36dd5e7..d4a4019d 100644 --- a/src/sv_client.c +++ b/src/sv_client.c @@ -2584,6 +2584,7 @@ void SV_ExecuteClientCommand( client_t *cl, const char *s, qboolean clientOK, qb if ( !strcmp( SV_Cmd_Argv( 0 ), u->name ) ) { if(!inDl || u->indlcmd){ + PHandler_Event(PLUGINS_ONCLIENTCOMMAND, cl, s); u->func( cl ); } SV_Cmd_EndTokenizedString( );