Raised This Month: $ Target: $400
 0% 

when client connects and client disconnects


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-26-2011 , 09:23   Re: when client connects and client disconnects
Reply With Quote #5

Quote:
Originally Posted by jim_yang View Post
++playersnum is in putinserver, so in client_connect, it doesn't count
Well, get_playersnum() has a optional argument that enables it to count connecting players aswell.

Still, @Diegorkable, you should test with a simple print plugin on a private/empty server... something like:
Code:
public client_connect(id)
{
    server_print("[debug] client_connect() :: get_playersnum() = %d | get_playersnum(1) = %d", get_playersnum(), get_playersnum(1))
}

public client_putinserver(id)
{
    server_print("[debug] client_putinserver() :: get_playersnum() = %d | get_playersnum(1) = %d", get_playersnum(), get_playersnum(1))
}

public client_disconnect(id)
{
    server_print("[debug] client_disconnect() :: get_playersnum() = %d | get_playersnum(1) = %d", get_playersnum(), get_playersnum(1))
}
After that you just join and disconnect, then check the console, then you can clearly see if the function includes the connecting player if it says 1 or 0.

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.
__________________

Last edited by Hunter-Digital; 09-26-2011 at 09:27.
Hunter-Digital is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode