diff --git a/modules/cstrike/csx/meta_api.cpp b/modules/cstrike/csx/meta_api.cpp index 81840be3..19f0f495 100644 --- a/modules/cstrike/csx/meta_api.cpp +++ b/modules/cstrike/csx/meta_api.cpp @@ -125,17 +125,27 @@ const char* get_localinfo( const char* name , const char* def = 0 ) return b; } +static bool ClientKill_wasAlive; + +void ClientKill(edict_t *pEntity) +{ + CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity); + ClientKill_wasAlive = pPlayer->IsAlive(); + + RETURN_META(MRES_IGNORED); +} + void ClientKill_Post(edict_t *pEntity) { CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity); - if ( pPlayer->IsAlive()) - RETURN_META(MRES_IGNORED); - - MF_ExecuteForward( iFDamage,static_cast(pPlayer->index), static_cast(pPlayer->index) , - static_cast(0), static_cast(0), static_cast(0), static_cast(0) ); // he would - pPlayer->saveKill(pPlayer,0,0,0); - MF_ExecuteForward( iFDeath,static_cast(pPlayer->index), static_cast(pPlayer->index), - static_cast(0), static_cast(0), static_cast(0) ); + if (ClientKill_wasAlive && !pPlayer->IsAlive()) + { + MF_ExecuteForward(iFDamage, static_cast(pPlayer->index), static_cast(pPlayer->index), + static_cast(0), static_cast(0), static_cast(0), static_cast(0)); // he would + pPlayer->saveKill(pPlayer, 0, 0, 0); + MF_ExecuteForward(iFDeath, static_cast(pPlayer->index), static_cast(pPlayer->index), + static_cast(0), static_cast(0), static_cast(0)); + } RETURN_META(MRES_IGNORED); } diff --git a/modules/cstrike/csx/moduleconfig.h b/modules/cstrike/csx/moduleconfig.h index d8aa5733..6f0ad412 100644 --- a/modules/cstrike/csx/moduleconfig.h +++ b/modules/cstrike/csx/moduleconfig.h @@ -119,7 +119,7 @@ // #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */ // #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */ #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */ -// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */ +#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */ // #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */ // #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */ // #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */