Get Online Player Count Bug?
#1

Hello, i have an problem, the problem is that for example: when 10 players online and 1 new guy come online it says then something like [36/50], but why is that so? I think the variables didnt reset or something like that.

Код:
new gPlayersConnected = 0;



// OnPlayerConnect

gPlayersConnected++;
new string[124], name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Player %s connected. There are %d/50 players connected", name, gPlayersConnected);
SendClientMessage(playerid, -1, string);


// OnPlayerDisconnect

gPlayersConnected--;
new string[124];
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Player %s left the server. There are %d/50 players connected", name, gPlayersConnected);
SendClientMessage(playerid, -1, string);
Reply
#2

Also like this?:

Код:
stock GetConnectedPlayers() return Iter_Count(Character);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)