Raised This Month: $12 Target: $400
 3% 

catching team select?¿


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-27-2010 , 09:46   Re: catching team select?¿
Reply With Quote #11

This does not affect the functionality or anything but...

new g_team_cnt[ CsTeams:4 ]

CsTeams = 4, no need to use a tag with the number 4.

new g_team_cnt[ CsTeams ]
__________________

Last edited by Bugsy; 04-27-2010 at 09:55.
Bugsy is offline
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 04-27-2010 , 17:17   Re: catching team select?¿
Reply With Quote #12

im srry i know that sylwaster already give me a code that works but i want to make it myself or at least just try.

the point is why this doesn't work?

PHP Code:
client_disconnect(id)
{
    if( 
g_team[id] == KEY_T )
    {
        
count_t--
    }
    if( 
g_team[id] == KEY_CT )
    {
        
count_ct--
    }

liryck is offline
Send a message via MSN to liryck
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-27-2010 , 17:26   Re: catching team select?¿
Reply With Quote #13

You could debug yourself. Try printing the value if you are not sure why something is not working.

Show which code you are using.
__________________

Last edited by Bugsy; 04-27-2010 at 17:29.
Bugsy is offline
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 04-27-2010 , 17:33   Re: catching team select?¿
Reply With Quote #14

this is the wolle code like i said b4 i got who's join to CT T and if they change from 1 team to other but at the moment to discount when some one disconnect from my count_ct and coun_t it just doesn't work

PHP Code:
public plugin_init() 
{
    
register_concmd("chooseteam""MainMenu"0"MainMenu")
    
register_event"TeamInfo""join_team""a")
    
//g_enable = register_cvar("g_enable","0");
    //register_clcmd( "say .test", "test" );
    
register_concmd"test""test" );
    
set_task(1.0"show_teams_hud"5335__"b" )
    
}

public 
test()
{
    
client_print(0,print_chat,"T_Team is %d = CT_Team is %d",count_t,count_ct)
    
server_print("T_Team is %d = CT_Team is %d",count_t,count_ct)
}

public 
client_connect(id)
{
    
g_connected[id] = false
    g_team
[id] = KEY_U
}

public 
join_team()
{    
    new 
id read_data(1)
    static 
user_team[32]
    new 
iPlayers[32],iNum
    
    
    get_players
(iPlayers,iNum)
    
read_data(2user_team31)    
    
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE    
    
    
switch(user_team[0])
    {
        case 
'C':  
        {
        
            for( new 
0iNumi++ )
       {
           if(
g_team[id] == KEY_T)
        {
            
g_team[id] = KEY_CT
            iTeams
[g_team[id]]++
            
count_ct++
        }
        
        if ( 
iPlayers] == id && g_connected[id] == false){
            
//client_print(0,print_chat,"asd , asd")
            
            
count_ct++
            
g_connected[id] = true
            g_team
[id] = KEY_CT
            old_team 
g_team[id]
        }
            
       }      
        }
            
        case 
'T'
        {
            for( new 
0iNumi++ )
       {
        if( 
g_team[id] == KEY_CT)
        {
            
g_team[id] = KEY_T
            count_ct
--
            
count_t++
        }
        
        if ( 
iPlayers] == id && g_connected[id] == false){
            
//client_print(0,print_chat,"asd , asd")
        
            
count_t++
            
g_connected[id] = true
            g_team
[id] = KEY_T
        
}
            
       } 
        }        
    }
    return 
PLUGIN_CONTINUE
    
}  

client_disconnect(id)
{
    if( 
g_team[id] == KEY_T )
    {
        
count_t--
    }
    if( 
g_team[id] == KEY_CT )
    {
        
count_ct--
    }

liryck is offline
Send a message via MSN to liryck
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 04-27-2010 , 17:49   Re: catching team select?¿
Reply With Quote #15

client_disconnect must be public
__________________
Impossible is Nothing
Sylwester is offline
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 04-27-2010 , 17:56   Re: catching team select?¿
Reply With Quote #16

rolf incredible mg should get some rest
liryck is offline
Send a message via MSN to liryck
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 06:35.


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