Results 1 to 6 of 6

Thread: Getting a random player from team?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Quote Originally Posted by Mitch View Post
    Can you post the code that you used? And for which cod version is it?
    cod2, well i tried many things but something like that, but that not work:


    PHP Code:
    level.alliesteam = [];
    players getentarray("player""classname");
        for(
    0players.sizei++)
        {
            if((
    isdefined(players.pers["team"])) && (players.pers["team"] == "allies") && (players.sessionstate == "playing"))
                
    level.alliesteam[level.level.alliesteam.size] = players;
        }
          
    random level.alliesteam[randomint(level.alliesteam.size)]; 
    Last edited by voron00; 23rd June 2015 at 17:04.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •