From 3d1162ecd96c903cbf57da6d93d3837059988fd6 Mon Sep 17 00:00:00 2001 From: Lukasz Wlasinksi Date: Mon, 25 Oct 2004 11:05:59 +0000 Subject: [PATCH] client_ forwards will now work with kill command --- dlls/csx/source/meta_api.cpp | 12 ++++++++++++ dlls/csx/source/moduleconfig.h | 2 +- dlls/csx/source/rank.cpp | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/csx/source/meta_api.cpp b/dlls/csx/source/meta_api.cpp index 11e45cef..4fc26414 100755 --- a/dlls/csx/source/meta_api.cpp +++ b/dlls/csx/source/meta_api.cpp @@ -110,6 +110,18 @@ const char* get_localinfo( const char* name , const char* def = 0 ) return b; } +void ClientKill(edict_t *pEntity){ + CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity); + if ( !pPlayer->IsAlive()) + RETURN_META(MRES_IGNORED); + + MF_ExecuteForward( iFDamage,pPlayer->index , pPlayer->index , 0, 0, 0, 0 ); + pPlayer->saveKill(pPlayer,0,0,0); + MF_ExecuteForward( iFDeath,pPlayer->index, pPlayer->index, 0, 0, 0 ); + + RETURN_META(MRES_IGNORED); +} + void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){ rankBots = (int)csstats_rankbots->value ? true:false; diff --git a/dlls/csx/source/moduleconfig.h b/dlls/csx/source/moduleconfig.h index 164b8864..b108733b 100755 --- a/dlls/csx/source/moduleconfig.h +++ b/dlls/csx/source/moduleconfig.h @@ -70,7 +70,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 */ diff --git a/dlls/csx/source/rank.cpp b/dlls/csx/source/rank.cpp index 1db48680..61d6e735 100755 --- a/dlls/csx/source/rank.cpp +++ b/dlls/csx/source/rank.cpp @@ -389,7 +389,7 @@ AMX_NATIVE_INFO stats_Natives[] = { { "xmod_get_stats_size", get_stats_size }, //*************************************** - { "get_weaponname", get_wpnname }, + //{ "get_weaponname", get_wpnname }, ///******************* { NULL, NULL }