Count joins
#1

How to count player's joins after the last server restart and get the info by a string??

Thanks.
Reply
#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
#3

Thanks.

My 'stupid' issue, was that i wrote %s instead of %d, so it was showing buggy.

Thanks again for your answer speed. +REP
Reply
#4

Do count has a limit?

Thanks.
Reply
#5

No Variables don't have number limits
the limit is too much for anyone to handle, lol
Reply
#6

Yes: 2,147,483,647 (signed* 32 bit).

* PAWN is a typeless 32 bit scripting language and integer variables are by default signed.
Reply
#7

Btw i don't think on my server will totally join 2 billions of players on 24 hours.

Thanks & Best Regards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)