Results 1 to 6 of 6

Thread: Getting a random player from team?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Private First Class php's Avatar
    Join Date
    Nov 2012
    Posts
    142
    Thanks
    28
    Thanked 116 Times in 59 Posts
    try

    PHP Code:
    level.alliesteam = [];
    players getentarray("player""classname");
    for(
    0players.sizei++)
    if(
    isdefined(players[i].pers["team"]) && players[i].pers["team"] == "allies" && players[i].sessionstate == "playing")
    level.alliesteam[level.alliesteam.size] = players[i];
    random level.alliesteam[randomint(level.alliesteam.size)]; 
    I edited the players to players[i]

  2. The Following User Says Thank You to php For This Useful Post:

    voron00 (23rd June 2015)

Posting Permissions

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