Help little stuck
#1
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.

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(); } }
Reply

#2
Code:
players = GetEntArray( "player", "classname" ); num = RandomInt( players.size ); for( x = 0; x < players.size; x++ ) { if( x == num ) { players[x] makeInfected(); } }
[Image: MaEIQ.png]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Impossible] Stuck on you iAegle 5 4,502 02-02-2011, 12:59
Last Post: AZUMIKKEL

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.