Count joins
#2

Create a global variable that you'll use to keep record on the amount of connections, increment the variable when a new player connects and reset it under OnGameModeInit (when the server [re]starts):

PHP код:
new playersJoined;
public 
OnGameModeInit() {
    
playersJoined 0;
    return 
true;
}
public 
OnPlayerConnect(playerid) {
    
playersJoined ++;
    return 
true;
}
// Assuming you're using ZCMD
CMD:lastserverrestart(playerid) {
    new
        
string[61];
    
format(stringsizeof(string), "%i players have connected since the last server restart."playersJoined);
    
SendClientMessage(playerid, -1string);
    return 
true;

If that's not what you meant, then please elaborate.
Reply


Messages In This Thread
Count joins - by Harty - 05.04.2016, 12:19
Re: Count joins - by AndySedeyn - 05.04.2016, 12:31
Re: Count joins - by Harty - 05.04.2016, 12:49
Re: Count joins - by Harty - 05.04.2016, 12:54
Re: Count joins - by Vanter - 05.04.2016, 12:54
Re: Count joins - by AndySedeyn - 05.04.2016, 13:00
Re: Count joins - by Harty - 05.04.2016, 13:04

Forum Jump:


Users browsing this thread: 1 Guest(s)