Raised This Month: $ Target: $400
 0% 

cs_set_user_team problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-06-2018 , 21:56   Re: cs_set_user_team problem
Reply With Quote #1

PHP Code:
#define isTeam(%0)         (CS_TEAM_T <= cs_get_user_team(%0) <= CS_TEAM_CT)

public SwapTeams()
{
    new 
iPlayers[MAX_PLAYERS], iNum
    get_players
(iPlayersiNum)
    for(new 
iidiNum;i++)
    {
        
id iPlayers[i]
        
        if(
isTeam(id))
        {
            
cs_set_user_team(id, (cs_get_user_team(id) == CS_TEAM_T) ? CS_TEAM_CT CS_TEAM_T)
            
set_task(1.5"DeadOnResp")
        }
    }
}

public 
DeadOnResp()
{
    new 
players[32];
    new 
numiid;
    
get_players(playersnum);
        
    for(
0numi++)
    {
        
id players[i];
            
        if(
isTeam(id) && !is_user_alive(id))
        {
            
ExecuteHam(Ham_CS_RoundRespawnid)
        }
    }

iceeedr is offline
Send a message via Skype™ to iceeedr
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:50.


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