Raised This Month: $18 Target: $400
 4% 

[ReQ] teams switch after round 10


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-12-2020 , 01:52   Re: [ReQ] teams switch after round 10
Reply With Quote #71

No, it will require code changes to the plugin and you will need to place signature file(s) in a specific directory to make it work.
__________________
Bugsy is offline
Ahmad111
Member
Join Date: Jul 2019
Old 04-12-2020 , 02:02   Re: [ReQ] teams switch after round 10
Reply With Quote #72

Quote:
Originally Posted by Bugsy View Post
No, it will require code changes to the plugin and you will need to place signature file(s) in a specific directory to make it work.
so you will change code?
Ahmad111 is offline
ZaX
Member
Join Date: Jan 2015
Old 04-12-2020 , 02:37   Re: [ReQ] teams switch after round 10
Reply With Quote #73

just upgrade to amxx 1.9. you keep spamming the same reply over and over
__________________
ZaX is offline
Ahmad111
Member
Join Date: Jul 2019
Old 04-12-2020 , 08:09   Re: [ReQ] teams switch after round 10
Reply With Quote #74

Quote:
Originally Posted by ZaX View Post
just upgrade to amxx 1.9. you keep spamming the same reply over and over
no one called you to HELP!
im speaking with Bugsy
so don't stick your nose!!!
Ahmad111 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-12-2020 , 08:30   Re: [ReQ] teams switch after round 10
Reply With Quote #75

Quote:
Originally Posted by Ahmad111 View Post
no one called you to HELP!
im speaking with Bugsy
so don't stick your nose!!!
Why are you being rude? Bugsy already explained to you - upgrading to 1.9 is the easisest and fastest solution. Upgrading from 1.8.2 to 1.9 takes only ~15 seconds. Rewriting the code with Orpheu will take a lot longer, so there's no need for any of this.

Bear in mind that if you're using ReHLDS, Orpheu won't even work for you.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-12-2020 , 14:12   Re: [ReQ] teams switch after round 10
Reply With Quote #76

Here's a 1.8.2 version using orpheu. Signatures and code taken from here. Good luck
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <orpheu>
#include <orpheu_memory>

new const Version[] = "0.3";

#define set_mp_pdata(%1,%2)  ( OrpheuMemorySetAtAddress( g_pGameRules, %1, 1, %2 ) )

new g_iRoundsWonCsTeams ] , g_pCvarRoundsToSwitch g_bPluginOn g_pGameRules;

public 
plugin_precache()
{
    
OrpheuRegisterHookOrpheuGetFunction"InstallGameRules" ) , "OnInstallGameRules" OrpheuHookPost );
}

public 
plugin_init() 
{
    
register_plugin"Team Switcher" Version "bugsy" );
    
    
g_pCvarRoundsToSwitch register_cvar"ts_switchatwonrounds" "10" );
    
    
register_clcmd"say /switch" "ToggleSwitch" );
    
register_clcmd"say_team /switch" "ToggleSwitch" );

    
register_clcmd"say /status" "ShowStatus" );
    
register_clcmd"say_team /status" "ShowStatus" );
    
    
register_event"SendAudio" "TWin" "a" "2&%!MRAD_terwin" );
    
register_event"SendAudio" "CTWin" "a" "2&%!MRAD_ctwin" );

    
g_bPluginOn true;
}


public 
OnInstallGameRules()
{
    
g_pGameRules OrpheuGetReturn();
}

public 
ToggleSwitchid )
{
    if ( !( 
get_user_flagsid ) & ADMIN_KICK ) )
        return 
PLUGIN_HANDLED;
    
    
g_bPluginOn = !g_bPluginOn;
    
    
client_printid print_chat "[AMXX]: The switch teams is now %sactivated!" g_bPluginOn "" "de-" );
    
    return 
PLUGIN_HANDLED;
}

public 
ShowStatusid )
{
    if ( !( 
get_user_flagsid ) & ADMIN_KICK ) )
        return 
PLUGIN_HANDLED;
        
    if ( 
g_bPluginOn )
    {    
        
client_print(idprint_chat,"* [CT Wins]: %d  |  [T Wins]: %d" g_iRoundsWonCS_TEAM_CT ] , g_iRoundsWonCS_TEAM_T ] );
    }
    else
    {
        
client_print(idprint_chat,"* Server Not Mixed");
    }
    
    return 
PLUGIN_HANDLED;
}


public 
TWin()
{
    if ( 
g_bPluginOn )
    {
        
g_iRoundsWonCS_TEAM_T ]++;
        
CheckWinsCS_TEAM_T );
    }
}

public 
CTWin()
{
    if ( 
g_bPluginOn )
    {
        
g_iRoundsWonCS_TEAM_CT ]++;
        
CheckWinsCS_TEAM_CT );
    }
}

CheckWinsCsTeamscsTeam )
{
    new 
iPlayers32 ] , iNum iPlayer CsTeams:csCurrentTeam iTemp;
    
    if ( 
g_iRoundsWoncsTeam ] && !( ( g_iRoundsWoncsTeam ] % get_pcvar_numg_pCvarRoundsToSwitch ) ) ) )
    {
        
get_playersiPlayers iNum );
        
        for ( new 
iNum i++ )
        {
            
iPlayer iPlayers];
            
csCurrentTeam cs_get_user_teamiPlayer );
            
            if ( 
CS_TEAM_T <= csCurrentTeam <= CS_TEAM_CT )
            {
                
cs_set_user_teamiPlayer , ( csCurrentTeam == CS_TEAM_T ) ? CS_TEAM_CT CS_TEAM_T );
            }
        }
        
        
iTemp g_iRoundsWonCS_TEAM_T ];
        
g_iRoundsWonCS_TEAM_T ] = g_iRoundsWonCS_TEAM_CT ];
        
g_iRoundsWonCS_TEAM_CT ] = iTemp;
        
        
set_task0.1 "SetScoreDelay" );
    }
}

public 
SetScoreDelay()
{
    
set_mp_pdata"m_iNumTerroristWins" g_iRoundsWonCS_TEAM_T ] );
    
set_mp_pdata"m_iNumCTWins" g_iRoundsWonCS_TEAM_CT ] );
        
    
UpdateTeamScores( .notifyAllPlugins true );
}

UpdateTeamScores( const bool:notifyAllPlugins false )
{
    static 
OrpheuFunction:handleFuncUpdateTeamScores;
    
    if ( !
handleFuncUpdateTeamScores )
    {
        
handleFuncUpdateTeamScores OrpheuGetFunction"UpdateTeamScores""CHalfLifeMultiplay" );
    }
    
    ( 
notifyAllPlugins ) ?
    
OrpheuCallSuperhandleFuncUpdateTeamScoresg_pGameRules ) :
    
OrpheuCallhandleFuncUpdateTeamScoresg_pGameRules );

Attached Files
File Type: zip [signatures] teamscore.zip (2.3 KB, 4 views)
__________________
Bugsy is offline
Ahmad111
Member
Join Date: Jul 2019
Old 05-04-2020 , 10:59   Re: [ReQ] teams switch after round 10
Reply With Quote #77

Quote:
Originally Posted by Bugsy View Post
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>

new const Version[] = "0.3";

new 
g_iRoundsWonCsTeams ] , g_pCvarRoundsToSwitch g_bPluginOn;

public 
plugin_init() 
{
    
register_plugin"Team Switcher" Version "bugsy" );
    
    
g_pCvarRoundsToSwitch register_cvar"ts_switchatwonrounds" "10" );
    
    
register_clcmd"say /switch" "ToggleSwitch" );
    
register_clcmd"say_team /switch" "ToggleSwitch" );

    
register_clcmd"say /status" "ShowStatus" );
    
register_clcmd"say_team /status" "ShowStatus" );
    
    
register_event"SendAudio" "TWin" "a" "2&%!MRAD_terwin" );
    
register_event"SendAudio" "CTWin" "a" "2&%!MRAD_ctwin" );

    
g_bPluginOn true;
}

public 
ToggleSwitchid )
{
    if ( !( 
get_user_flagsid ) & ADMIN_KICK ) )
        return 
PLUGIN_HANDLED;
    
    
g_bPluginOn = !g_bPluginOn;
    
    
client_printid print_chat "[AMXX]: The switch teams is now %sactivated!" g_bPluginOn "" "de-" );
    
    return 
PLUGIN_HANDLED;
}

public 
ShowStatusid )
{
    if ( !( 
get_user_flagsid ) & ADMIN_KICK ) )
        return 
PLUGIN_HANDLED;
        
    if ( 
g_bPluginOn )
    {    
        
client_print(idprint_chat,"* [CT Wins]: %d  |  [T Wins]: %d" g_iRoundsWonCS_TEAM_CT ] , g_iRoundsWonCS_TEAM_T ] );
    }
    else
    {
        
client_print(idprint_chat,"* Server Not Mixed");
    }
    
    return 
PLUGIN_HANDLED;
}


public 
TWin()
{
    if ( 
g_bPluginOn )
    {
        
g_iRoundsWonCS_TEAM_T ]++;
        
CheckWinsCS_TEAM_T );
    }
}

public 
CTWin()
{
    if ( 
g_bPluginOn )
    {
        
g_iRoundsWonCS_TEAM_CT ]++;
        
CheckWinsCS_TEAM_CT );
    }
}

CheckWinsCsTeamscsTeam )
{
    new 
iPlayers32 ] , iNum iPlayer CsTeams:csCurrentTeam iTemp;
    
    if ( 
g_iRoundsWoncsTeam ] && !( ( g_iRoundsWoncsTeam ] % get_pcvar_numg_pCvarRoundsToSwitch ) ) ) )
    {
        
get_playersiPlayers iNum );
        
        for ( new 
iNum i++ )
        {
            
iPlayer iPlayers];
            
csCurrentTeam cs_get_user_teamiPlayer );
            
            if ( 
CS_TEAM_T <= csCurrentTeam <= CS_TEAM_CT )
            {
                
cs_set_user_teamiPlayer , ( csCurrentTeam == CS_TEAM_T ) ? CS_TEAM_CT CS_TEAM_T );
            }
        }
        
        
iTemp g_iRoundsWonCS_TEAM_T ];
        
g_iRoundsWonCS_TEAM_T ] = g_iRoundsWonCS_TEAM_CT ];
        
g_iRoundsWonCS_TEAM_CT ] = iTemp;
        
        
set_gamerules_int"CHalfLifeMultiplay" "m_iNumTerroristWins" g_iRoundsWonCS_TEAM_T ] );
        
set_gamerules_int"CHalfLifeMultiplay" "m_iNumCTWins" g_iRoundsWonCS_TEAM_CT ] );
    }

after i dl the amxmodx 1.9.0 the plugin works
but the score bored rounds win not switched.
Ahmad111 is offline
Ahmad111
Member
Join Date: Jul 2019
Old 05-19-2020 , 22:09   Re: [ReQ] teams switch after round 10
Reply With Quote #78

guys any one ?
Ahmad111 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:31.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode