Raised This Month: $ Target: $400
 0% 

[HELP]Return user to team.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-02-2014 , 10:04   Re: [HELP]Return user to team.
Reply With Quote #4

PHP Code:
new g_Team[33//create global array

enum
{
    
T_TEAM 1,
    
CT_TEAM
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""fwd_Spawn_Post"1// spawn forward to check user team when spawn
}

public 
fwd_Spawn_Post(id)
{
    if (
is_user_alive(id))
    {
        if (
cs_get_user_team(id) == CS_TEAM_T// if user team is ct
        
{
            
g_Team[id] = T_TEAM // save user team as in g_Team
        
}
        else if (
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
g_Team[id] = CT_TEAM // save user team as in g_Team
        
}
        
        if (
g_Team[id] == T_TEAM// if g_Team is equal with team T
        
{
            
cs_set_user_team(idCS_TEAM_T//set to T
        
}
        else
        {
            
cs_set_user_team(idCS_TEAM_CT)  //set to CT
        
}
    }

__________________
What are you looking for here?
DavidJr is offline
 



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 10:13.


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