Raised This Month: $ Target: $400
 0% 

I am confused.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 09:49   Re: Crashing server on swap teams...
Reply With Quote #1

Add a delay when switching teams, or use this to change teams.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 05-07-2012, 10:20
kileedyg
This message has been deleted by kileedyg. Reason: UNACCESARY
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 10:55   Re: Crashing server on swap teams...
Reply With Quote #3

Quote:
Originally Posted by kileedyg View Post
PHP Code:
SwapTeams( )
{
    for( new 
1<= g_iMaxPlayersi++ )
    {
        if( 
is_user_connected) )
        {
            switch( 
get_user_team) )
            {
                case 
CS_TEAM_T:
                {
                    
cs_set_team_idiTEAM_CT );
                }
                    
                case 
CS_TEAM_CT:
                {
                    
cs_set_team_idiTEAM_TERRORIST );
                }
            }
        }
    }

is this correct?
You should use cs_set_team().

As for the rest, copy/pasting code into a plugin is really bad. You should understand what you are doing instead of piecing bits and pieces together of what you want.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 05-07-2012, 11:11
kileedyg
This message has been deleted by kileedyg. Reason: UNACCESARY
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 11:12   Re: Crashing server on swap teams...
Reply With Quote #5

Don't cross-post about other threads for help.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 05-07-2012, 11:15
kileedyg
This message has been deleted by kileedyg. Reason: UNACCESARY
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 15:26   Re: Crashing server on swap teams...
Reply With Quote #7

PHP Code:
SwapTeams( )
{
    const 
GROUP 5// at a time
    
const Float:INTERVAL 0.5// delay between groups
    
    
new switcheddata];
    
    for( new 
1<= g_iMaxPlayersi++ )
    {
        if( 
is_user_connected) )
        {
            
data] = get_user_team);
            
            if( 
TEAM_T <= data] <= TEAM_CT )
            {
                
data] = data];
                
                if( 
switched++ < GROUP )
                {
                    
TaskSwitchdata);
                }
                else
                {
                    
set_taskINTERVAL * ( switched GROUP ), "TaskSwitch"idatasizeofdata ) );
                }
            }
        }
    }
}

public 
TaskSwitchdata[ ], id )
{
    if( 
is_user_connectedid ) )
    {
        
cs_set_teamiddata] );
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-07-2012 , 13:05   Re: Crashing server on swap teams...
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
Add a delay when switching teams
Such as switching 5 players every 0.5 seconds.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 00:28.


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