SA-MP Forums Archive
Total Players Online - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Total Players Online (/showthread.php?tid=138667)



Total Players Online - INeedHelp - 02.04.2010

If a player connects,how i can add such a stuff that it will say like this: %s has joined the server.(Total players online: OnLinePlayersNumbers)


Re: Total Players Online - Jefff - 02.04.2010

Top
Код:
stock GetOnlinePlayers()
{
	new count,g=GetMaxPlayers();
	for(new d; d<g; d++) if(IsPlayerConnected(d) && !IsPlayerNPC(d)) count++;
	return count;
}
connect
Код:
new On‌line = GetOnlinePlayers();
%s has joined the server.(Total players online: %d),Nick,Online);



Re: Total Players Online - Torran - 02.04.2010

Quote:
Originally Posted by Jefff
Top
Код:
stock GetOnlinePlayers()
{
	new count,g=GetMaxPlayers();
	for(new d; d<g; d++) if(IsPlayerConnected(d) && !IsPlayerNPC(d)) count++;
	return count;
}
connect
Код:
new On‌line = GetOnlinePlayers();
%s has joined the server.(Total players online: %d),Nick,Online);
Why do you name it?
You can do:

pawn Код:
format(string, sizeof string, "%s has joined the server.(Total players online: %d),Nick, GetOnlinePlayers());