[code] infinity loop
PHP Code:
|
Re: [code] infinity loop
The correct code was posted later on that thread.
Here I adapted it to reset the index after the first time select all players, when you call display_random_reset( id ):
Spoiler
|
Re: [code] infinity loop
Quote:
PHP Code:
|
Re: [code] infinity loop
Quote:
Code:
|
Re: [code] infinity loop
Quote:
Code:
Code:
edit: is this the right way of making to pick from specific team ? Code:
|
Re: [code] infinity loop
1 Attachment(s)
Quote:
Quote:
If the player was not connect, he would not be selected because every time he disconnect/connect he is added/removed from the selection. The better point I think to do this is here: Code:
|
Re: [code] infinity loop
Quote:
Code:
its working perfect now but just some small issuses like for ex: you call radom 3 times it gives you: 7 3 1 the you call it another time it gives your 7 3 1 its rare but happens or other thing for ex you get: 7 3 1 next time you do random you get 1 7 3 so you have the number 1 selected twice in a row but i guess thats how random_num() works. edit: https://forums.alliedmods.net/showpo...91&postcount=7 Code:
is this okay ? |
Re: [code] infinity loop
Quote:
Code:
Quote:
Your function GetAliveCt() do not need to count all cts, unless you need the total alive. Then it just could be: Code:
But is you need all alive CTs total and their ids, you can use a built-in function which should be faster: Code:
Quote:
|
Re: [code] infinity loop
Quote:
Quote:
Quote:
|
Re: [code] infinity loop
If you still need help, check my signature for TTT mod, where I get all players and then randomly assign them roles and make sure all of them have a role at the end.
|
| All times are GMT -4. The time now is 17:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.