SA-MP Forums Archive
[FilterScript] Player online count+record of players - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Player online count+record of players (/showthread.php?tid=564654)



Player online count+record of players - Kruno88 - 22.02.2015

Online player count+Record system
A simple system that has a record of players ever connected+it can detect how many players are online.
The record is saved in record.txt file.
Online players are seen with

Code:
PlayerCount
A little command that tells you how many players are online.
Code:
	if (strcmp("/online", cmdtext, true, 10) == 0)
	{
	format(str,sizeof(str),"Online players: [%d]",PlayerCount);
	SendClientMessage(playerid,-1,str);
		return 1;
	}
Download:
Pastenbin.com


Re: Player online count+record of players - Glossy42O - 22.02.2015

You can simply just press "TAB" and see the number.


Re: Player online count+record of players - Kruno88 - 22.02.2015

Quote:
Originally Posted by Stuun23
View Post
You can simply just press "TAB" and see the number.
And can the server see player number with 'TAB'?


Re: Player online count+record of players - DRIFT_HUNTER - 22.02.2015

Quote:
Originally Posted by Kruno88
View Post
And can the server see player number with 'TAB'?
Yes (I think its in a header)


Re: Player online count+record of players - MohanedZzZ - 22.02.2015

This not even a filterscript
SAMP Players counter



Re: Player online count+record of players - Steel_ - 22.02.2015

If it was a textdraw it would be useful.


Re: Player online count+record of players - Schneider - 22.02.2015

Some of the code is not even making sense...


Re: Player online count+record of players - Kruno88 - 22.02.2015

Okey,how will you detect if there are 10 players online,within the script


Re: Player online count+record of players - Schneider - 22.02.2015

You are already doing that with the PlayerCount variable, raising it @ OnPlayerConnect and decrease @OnPlayerDisconnect. It's just that the function "ConnectingOfPlayer()" is useless since it will return the same number as the PlayerCount-variable already has...


..also the code at OnPlayerSpawn is useless and will just annoy the players each time a player dies and spawns.


..also why do you reset the record in the file when the script starts? What would be the point of saving the number in the file if you reset it anyway?


Re: Player online count+record of players - Kruno88 - 22.02.2015

Quote:
Originally Posted by Stuun23
View Post
You can simply just press "TAB" and see the number.
Quote:
Originally Posted by Schneider
View Post
You are already doing that with the PlayerCount variable, raising it @ OnPlayerConnect and decrease @OnPlayerDisconnect. It's just that the function "ConnectingOfPlayer()" is useless since it will return the same number as the PlayerCount-variable already has...


..also the code at OnPlayerSpawn is useless and will just annoy the players each time a player dies and spawns.
Ok.Btw you joined in 2007,while I was still 3d grade.So...Thanx for your suggestion.
OnPlayerSpawn funcion is just an example of a proper use of it.