Raised This Month: $ Target: $400
 0% 

[REQ Edit] TeamSwitch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mattisbogus
Senior Member
Join Date: Jun 2009
Location: North Carolina, USA
Old 02-07-2010 , 15:45   [REQ Edit] TeamSwitch
Reply With Quote #1

If someone could please help me edit this plugin I would be extremely appreciated. I have tried & tried to edit this myself, and I can only get it to to set the settings once, instead of detecting the correct human teams, and setting the settings correctly.

PHP Code:
#include < amxmodx >
#include < cstrike >

new g_iRounds
new g_pSwitchAfter

public plugin_init( )
{
    
register_plugin"TeamSwitcher""1.0""Battousai-sama" )
    
register_logevent"LogeventEndRound"2"1=Round_End" )

    
g_pSwitchAfter register_cvar"amx_switch_after""2" )
}

public 
LogeventEndRound( )
{
    if ( 
g_iRounds++ > get_pcvar_numg_pSwitchAfter ) )
    {
        new 
iPlayers32 ]
        new 
iNum
        get_players
iPlayersiNum )

        for ( new 
0iNuma++ )
            switch ( 
cs_get_user_teamiPlayers] ) )
            {
                case 
1:
                    
cs_set_user_teamiPlayers], CS_TEAM_CT )
                case 
2:
                    
cs_set_user_teamiPlayers], CS_TEAM_T )
            }

        
g_iRounds 0
        
return
    }
    
g_iRounds++

The 2 settings I need set are "ajc_team <1|2>" & "pb_bot_join_team <ct|t>"

I need this set in a way, that when the plugin switches the human teams to CT, ajc_team = 2 and pb_bot_join_team = T, and when the plugin changes the human teams to T ajc_team = 1 and pb_bot_join_team = CT
mattisbogus is offline
Reply



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 07:27.


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