Highest players per day - 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)
+--- Thread: Highest players per day (
/showthread.php?tid=309924)
Highest players per day -
Alexander_123 - 09.01.2012
Hi!
I want a script like if a player come in my server ( suppose 15 players) it should record.
It should save everyday.Can anyone give me script like that?
Re: Highest players per day -
MR,Mr - 09.01.2012
Top of GM/FS
pawn Код:
new players = 0;//This stores the current players value
new topplayers = 0;//This stores the highest players so far
forward GetTopPlayers();
Under OnPlayerConnect
pawn Код:
++players;//increase the connected players by 1
if(players > topplayers)//If there are more players in the server than the current topplayers
{
topplayers = players;//topplayers = currentplayers
}
-- As per vinces post, this can go here instead.
Under OnPlayerDisconnect
pawn Код:
--players;//Decrease the connected players by 1
If I am correct, this should work (not tested)
However, this will just store a value inside the script, nothing is done with it yet. Where do you want the top players for the day to be stored?
Re: Highest players per day -
Vince - 09.01.2012
You don't need the timer. You can just perform that check when a player connects (after you've increased the players variable).
Re: Highest players per day -
MR,Mr - 09.01.2012
Quote:
Originally Posted by Vince
You don't need the timer. You can just perform that check when a player connects (after you've increased the players variable).
|
This is true, I'm not very efficient in my coding tonight