Raised This Month: $ Target: $400
 0% 

How to randomize teams?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-19-2009 , 15:42   Re: How to randomize teams?
Reply With Quote #1

Try this ->
PHP Code:
stock RandomizePlayers()
{
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNum"ch"); //Skip bots and HLTV
    
    
new iCTerror iPlayers[random(iNum)];
    new 
iPlr;
    for(new 
iNum i++)
    {
        
iPlr iPlayers[i];
        if(!
is_user_connected(iPlr)) //Cstrike odd thing
            
continue; 
        if(
iPlr == iCTerror)
        {
            
cs_set_user_team(iPlrCS_TEAM_CT);
        }
        else
        {
            
cs_set_user_team(iPlrCS_TEAM_T);
        }
    }
    return 
1;

Just call RandomizePlayers() and will do the thing.
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 08-19-2009 at 17:01.
Alka is offline
MasterKy
Junior Member
Join Date: Aug 2009
Old 08-25-2009 , 15:31   Re: How to randomize teams?
Reply With Quote #2

i do resolved it with other code! thanks for you! =D
MasterKy 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 15:11.


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