diff --git a/dlls/csstats2/csstats/CRank.cpp b/dlls/csstats2/csstats/CRank.cpp index 69e3d5f7..48838bcc 100755 --- a/dlls/csstats2/csstats/CRank.cpp +++ b/dlls/csstats2/csstats/CRank.cpp @@ -130,7 +130,7 @@ void RankSystem::clear(){ bool RankSystem::loadCalc(const char* filename, char* error) { - if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error,0)!=AMX_ERR_NONE)|| + if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error)!=AMX_ERR_NONE)|| (MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr1, &calc.physAddr1)!=AMX_ERR_NONE)|| (MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr2, &calc.physAddr2)!=AMX_ERR_NONE)|| (MF_AmxFindPublic(&calc.amx,"get_score",&calc.func)!=AMX_ERR_NONE)){ @@ -305,5 +305,4 @@ void RankSystem::saveRank( const char* filename ) fwrite( &i , 1, sizeof(short int), bfp); // null terminator fclose(bfp); -} - +} \ No newline at end of file diff --git a/dlls/csstats2/csstats/CRank.h b/dlls/csstats2/csstats/CRank.h index 797799e1..20a23430 100755 --- a/dlls/csstats2/csstats/CRank.h +++ b/dlls/csstats2/csstats/CRank.h @@ -119,5 +119,4 @@ public: }; -#endif - +#endif \ No newline at end of file diff --git a/dlls/csstats2/csstats/meta_api.cpp b/dlls/csstats2/csstats/meta_api.cpp index e987ebc7..6f016099 100755 --- a/dlls/csstats2/csstats/meta_api.cpp +++ b/dlls/csstats2/csstats/meta_api.cpp @@ -26,7 +26,6 @@ bool rankBots; int gmsgCurWeapon; int gmsgDeathMsg; int gmsgDamage; -int gmsgDamageEnd; int gmsgWeaponList; int gmsgResetHUD; int gmsgAmmoX; @@ -57,7 +56,6 @@ struct sUserMsg { } g_user_msg[] = { { "CurWeapon" , &gmsgCurWeapon , Client_CurWeapon, false }, { "Damage" , &gmsgDamage,Client_Damage, false }, - { "Damage" , &gmsgDamageEnd, Client_Damage_End, true }, { "WeaponList" , &gmsgWeaponList, Client_WeaponList, false }, { "ResetHUD" , &gmsgResetHUD,Client_ResetHUD, true }, { "AmmoX" , &gmsgAmmoX, Client_AmmoX , false }, @@ -289,7 +287,7 @@ void OnMetaAttach() { void OnAmxxAttach(){ MF_AddNatives(stats_Natives); - const char* path = get_localinfo("csstats_score","addons/amxmodx/data/csstats.amxx"); + const char* path = get_localinfo("csstats_score"); if ( path && *path ) { char error[128]; @@ -299,7 +297,7 @@ void OnAmxxAttach(){ if ( !g_rank.begin() ) { g_rank.loadRank( MF_BuildPathname("%s", - get_localinfo("csstats","addons/amxmodx/data/csstats.dat") ) ); + get_localinfo("csstats") ) ); } } diff --git a/dlls/csstats2/csstats/rank.h b/dlls/csstats2/csstats/rank.h index 60894885..5b61a65c 100755 --- a/dlls/csstats2/csstats/rank.h +++ b/dlls/csstats2/csstats/rank.h @@ -52,7 +52,6 @@ extern int mPlayerIndex; extern int mState; extern int gmsgCurWeapon; -extern int gmsgDamageEnd; extern int gmsgDamage; extern int gmsgWeaponList; extern int gmsgResetHUD; @@ -69,7 +68,6 @@ void Client_CurWeapon(void*); void Client_Damage(void*); void Client_WeaponList(void*); void Client_AmmoPickup(void*); -void Client_Damage_End(void*); void Client_ScoreInfo(void*); void Client_ResetHUD(void*); diff --git a/dlls/csstats2/csstats/usermsg.cpp b/dlls/csstats2/csstats/usermsg.cpp index cc95827b..08dbc15f 100755 --- a/dlls/csstats2/csstats/usermsg.cpp +++ b/dlls/csstats2/csstats/usermsg.cpp @@ -5,12 +5,6 @@ weaponsVault weaponData[MAX_WEAPONS]; -int damage; -int TK; -int weapon; -int aim; -CPlayer *pAttacker; - int g_Planter; int g_Defuser; @@ -52,6 +46,12 @@ void Client_WeaponList(void* mValue){ void Client_Damage(void* mValue){ static int bits; + static int damage; + static int TK; + static int weapon; + static int aim; + static CPlayer *pAttacker; + switch (mState++) { case 1: damage = *(int*)mValue; @@ -79,19 +79,16 @@ void Client_Damage(void* mValue){ } if( g_grenades.find(enemy , &pAttacker , &weapon ) ) pAttacker->saveHit( mPlayer , weapon , damage, aim ); - } -} - -void Client_Damage_End(void* mValue){ - if ( !mPlayer || !damage || mPlayer->IsAlive() ) - return; - + break; + case 4: if ( !pAttacker ) - pAttacker = mPlayer; + pAttacker = mPlayer; TK = 0; if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) ) - TK = 1; + TK = 1; pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TK); + break; + } } void Client_CurWeapon(void* mValue){