Oh ok, I've made it myself something like:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <orpheu>
#include <orpheu_memory>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define SCORE_T 0
#define SCORE_CT 1
#define set_mp_pdata(%1,%2) ( OrpheuMemorySetAtAddress( g_pGameRules, %1, 1, %2 ) )
#define get_mp_pdata(%1) ( OrpheuMemoryGetAtAddress( g_pGameRules, %1 ) )
new g_pGameRules;
new g_TeamScore[2];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TeamScore", "eventTeamScore", "a");
register_clcmd( "say /swap", "ClientCommand_SetTeamScore");
}
public plugin_precache()
{
OrpheuRegisterHook( OrpheuGetFunction( "InstallGameRules" ), "OnInstallGameRules", OrpheuHookPost );
}
public OnInstallGameRules()
{
g_pGameRules = OrpheuGetReturn();
}
public eventTeamScore()
{
new sTeam[2];
read_data(1, sTeam, 1);
if( sTeam[0] == 'T' )
{
g_TeamScore[SCORE_T] = read_data(2);
}
else
{
g_TeamScore[SCORE_CT] = read_data(2);
}
return PLUGIN_CONTINUE;
}
public ClientCommand_SetTeamScore ()
{
set_mp_pdata( "m_iNumCTWins", g_TeamScore[SCORE_T] );
set_mp_pdata( "m_iNumTerroristWins", g_TeamScore[SCORE_CT] );
UpdateTeamScores( .notifyAllPlugins = true );
}
UpdateTeamScores ( const bool:notifyAllPlugins = false )
{
static OrpheuFunction:handleFuncUpdateTeamScores;
if ( !handleFuncUpdateTeamScores )
{
handleFuncUpdateTeamScores = OrpheuGetFunction( "UpdateTeamScores", "CHalfLifeMultiplay" )
}
( notifyAllPlugins ) ?
OrpheuCallSuper( handleFuncUpdateTeamScores, g_pGameRules ) :
OrpheuCall( handleFuncUpdateTeamScores, g_pGameRules );
}
Tested and it works, but I think ur code is better anyways ? is it ?