question about ids and stuff ...
this is code ...
Code:
as you see, player could say .ready and he would be assigned into UserReady with his id. when someone types into server console check_whoisready, that loop will throw out anyone who has that id and is assigned into UserReady. i would like to know, if my code would work or the use of UserReady[id] is wrong, ec i mustn't use this loop to get players' ids. plz reply if you know the solution, ty :* |
Re: question about ids and stuff ...
You should declare the UserReady array somewhere. I would change your gets_playersnum to get_maxplayers. The reason for this is that a player can have a higher id than the current amount of players in the server (ie: he is one of only two players in the server but his id is 11), whereas it can't go higher than the max players. You should also set i to 1 instead of 0 then, because there is no player 0.
|
Re: question about ids and stuff ...
thank you :) but please explain:
"You should declare the UserReady array somewhere." where should i declare it? |
Re: question about ids and stuff ...
Outside any function, so that it is global (all functions have access to it). Most people declare all of their global variables at the top of the script. ie:
Code:
|
| All times are GMT -4. The time now is 04:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.