when client connects and client disconnects
Hey guys I have 2 huge questions that arent answered yet, that really confuse me and make me have a hard time when scripting in these forward publics (client_connect and client_disconnect), so i hope you'll give me the right answer so i'll finally be calm about it.
Question no. 1: in client_connect, if I do get_playersnum(), will it count the player that has just connected? Question no. 2: in client_disconnect, if I do get_playersnum(), will it count the player that has just disconnected? |
Re: when client connects and client disconnects
You can figure this out yourself, don't be lazy.
|
Re: when client connects and client disconnects
I did it few times, but wierd things happen!!!! I'll tell you what i tried.:
in client_connect i did get_playersnum and if it has 10 players set a pass and do a client print. in client_disconnect i did get_playersnum and if it has 10 players (before the client has left, meaning there are 9 now) remove the pass. And this is what happened: the 10th has logged in a pass was SET. the 10th has logged out the pass was REMVOED. the 8th has logged out a pass was set.... wierd random shit happen and i dont know why is this.. ill post the public here: PHP Code:
|
Re: when client connects and client disconnects
Code:
--playersnum is after client_disconnect forward, so it count |
Re: when client connects and client disconnects
Quote:
Still, @Diegorkable, you should test with a simple print plugin on a private/empty server... something like: Code:
public client_connect(id)EDIT: just out of curiosity I tested it myself, it seems it does count players as intended, get_playersnum() gets players in putinserver and disconnect, and with flag 1 it gets in all 3 forwards. |
Re: when client connects and client disconnects
Look at my code, didnt I do it right then...?
|
Re: when client connects and client disconnects
I have a question. I realise that yeah on connect it doesnt count and on disconnect it does. but I have 1 question. Sometime it fucks up when player is connect (it sees that he has connected then it sets a pass), and if he cancels the connection in the middle he just leaves and the password isnt being removed. How can I fix it? Therefore I think that if a player is in the middle of connecting (just passed client_connect), so if he cancels the loading client_disconnect isnt called? Cuz its not disable the password.
OR Maybe since he wasnt counted in get_playersnum() he wont be counted at disconnect either (if he terminated the connection to the server) |
Re: when client connects and client disconnects
Yes, disconnect is not called if player cancels while in loading.
You could just set password in putinserver :-?? |
Re: when client connects and client disconnects
Yes, but then a situation that 2 players are connecting when there are 9 players. it'll set a pass when there are 11 players only :s
|
Re: when client connects and client disconnects
Well, I did that on client_putinserver it sets the password if playernum is 10, and then check if there are any other users connecting and kicking them out with the reason "Server is FULL!"
|
| All times are GMT -4. The time now is 19:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.