Raised This Month: $ Target: $400
 0% 

How to randomize teams?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MasterKy
Junior Member
Join Date: Aug 2009
Old 08-19-2009 , 15:29   How to randomize teams?
Reply With Quote #1

hello, i need to randomize teams so:

1 = Counter Terrorist

the rest = terrorist

i make an plugin but this do not randomize and kill the players
how to do it not killing?
plz help me
MasterKy is offline
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 #2

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 #3

i do resolved it with other code! thanks for you! =D
MasterKy is offline
MasterKy
Junior Member
Join Date: Aug 2009
Old 08-19-2009 , 16:04   Re: How to randomize teams?
Reply With Quote #4

i test it but dont wor =(
plz any more help? if yes send me de full code plz!
MasterKy is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-19-2009 , 17:02   Re: How to randomize teams?
Reply With Quote #5

What ? This should work, i don't see any reason why it wouldn't...pos the whole code that you used.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Reply


Thread Tools
Display Modes

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