AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to randomize teams? (https://forums.alliedmods.net/showthread.php?t=100974)

MasterKy 08-19-2009 15:29

How to randomize teams?
 
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

Alka 08-19-2009 15:42

Re: How to randomize teams?
 
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.

MasterKy 08-19-2009 16:04

Re: How to randomize teams?
 
i test it but dont wor =(
plz any more help? if yes send me de full code plz!

Alka 08-19-2009 17:02

Re: How to randomize teams?
 
What ? This should work, i don't see any reason why it wouldn't...pos the whole code that you used.

MasterKy 08-25-2009 15:31

Re: How to randomize teams?
 
i do resolved it with other code! thanks for you! =D


All times are GMT -4. The time now is 15:11.

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