in the main write this:

Code:

if(connection == 3)
{
iPlayerConnected += 1;
}



this is not necesarry though, only if you run your game as server+client

create your character. and in the on_server function call this:

Code:

function server_called(strPlayerName)
{
ifdef server;
if(event_type == event_join)
{
iPlayerConnected += 1;
send_var(iPlayerConnected);
}
if(event_type == event_leave)
{
iPlayerConnected -= 1;
send_var(iPlayerConnected);
}
endif;
wait(1);
}




this should work, i use ti like this in my game and it works perfect.


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig