@@ -96,6 +96,9 @@ int g_iUserId[MAXPLAYERS+1];
9696bool g_bNewName [MAXPLAYERS +1 ] = {false , ...};
9797bool g_bTalking [MAXPLAYERS +1 ] = {false , ...};
9898
99+ /* Mod-specific stuff */
100+ char g_sPropScore [32 ] = " m_iScore" ;
101+
99102
100103public Plugin myinfo = {
101104 name = " SourceChatter" ,
@@ -129,6 +132,7 @@ public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int iErr
129132
130133public void OnPluginStart (){
131134 LoadTranslations (" common.phrases" );
135+ SetupModSpecificStuff ();
132136 RegisterCvars ();
133137 Database .Connect (Callback_OnConnect , " source_chatter" );
134138 RegisterCommands ();
@@ -145,6 +149,15 @@ public void OnLibraryAdded(const char[] sLibName){
145149 Updater_AddPlugin (UPDATE_URL );
146150}
147151
152+ /* this function sets up engine-specific properties */
153+ void SetupModSpecificStuff (){
154+ EngineVersion iVersion = GetEngineVersion ();
155+ switch (iVersion ){
156+ case Engine_TF2 :
157+ strcopy (g_sPropScore , sizeof (g_sPropScore ), " m_iTotalScore" );
158+ }
159+ }
160+
148161void RegisterCvars (){
149162 CreateConVar (" sm_sourcechatter_version" , PLUGIN_VERSION , " Current Source Chatter version" , FCVAR_NOTIFY | FCVAR_DONTRECORD | FCVAR_SPONLY );
150163
@@ -1021,7 +1034,7 @@ int GetClass(int client){
10211034
10221035int GetScore (int client ){
10231036 if (g_iResource == - 1 ) return 0 ;
1024- return GetEntProp (g_iResource , Prop_Send , " m_iTotalScore " , _ , client );
1037+ return GetEntProp (g_iResource , Prop_Send , g_sPropScore , _ , client );
10251038}
10261039
10271040int GetPing (int client ){
0 commit comments