06-29-2011, 20:28
need help making it to choose 1 random player out of everyone to be on axis team which is infected in this case.
I know there is a example in the jug file but the code differs from mine
what I want to do is get the number of players in the server into an array and then pick a random number within that array setting that player to infected.
I know there is a example in the jug file but the code differs from mine
what I want to do is get the number of players in the server into an array and then pick a random number within that array setting that player to infected.
Code:
players = GetEntArray( "player", "classname" );
for( x = 0; x < players.size; x++ )
{
player = players[ x ];
num = RandomInt( players.size );
if( player.pers[x] == num )
{
makeInfected();
}
}