AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [REQ Edit] TeamSwitch (https://forums.alliedmods.net/showthread.php?t=118087)

mattisbogus 02-07-2010 15:45

[REQ Edit] TeamSwitch
 
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


All times are GMT -4. The time now is 07:27.

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