Quote:
Originally Posted by jim_yang
++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.
__________________