[SOLVED]Pick random player of server
I need to get all round a random player, I tried a few ways posted, but none works.
Thanks. |
Re: Pick random player of server
You can store the potential clients in an array, and then use GetURandomInt and modulus to select a random one.
Spoiler
|
Re: Pick random player of server
Same concept, but you can also use new client = numClients ? iClients[GetRandomInt(0, (numClients - 1))] : -1 as opposed to GetURandomInt.
|
Re: Pick random player of server
I tried but did not work, one player is randomly chosen and win the HE.
PHP Code:
|
Re: Pick random player of server
Quote:
Quote:
Could also do: Code:
return (numClients) ? iClients[GetURandomInt() % numClients] : -1; |
Re: Pick random player of server
Thanks works perfectly.
|
All times are GMT -4. The time now is 07:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.