Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Credits:-
- Samp team For a_samp Include
- DTV For His Mini Help To Fix The TextDraw Error
- Me For The Script
- */
- #include a_samp
- #include Dini
- new Text:pcounter;
- new TimerRecord;
- new PlayerCount;
- new str[128];
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 100
- #define recordfile "precord.ini"
- forward ConnectingOfPlayer();
- public OnFilterScriptInit()
- {
- new string[8];
- format(string,sizeof(string),"%d/%d",PlayerCount,MAX_PLAYERS);
- pcounter = TextDrawCreate(309.000000, 9.000000, string);
- TextDrawAlignment(pcounter, 2);
- TextDrawBackgroundColor(pcounter, 255);
- TextDrawFont(pcounter, 1);
- TextDrawLetterSize(pcounter, 0.500000, 1.500000);
- TextDrawColor(pcounter, -1);
- TextDrawSetOutline(pcounter, 1);
- TextDrawSetProportional(pcounter, 1);
- if(!dini_Exists(recordfile))
- {
- dini_Create(recordfile);
- printf("File (%s) is made .",recordfile);
- }
- dini_IntSet(recordfile,"precord",0);
- TimerRecord = SetTimer("precord",180000,true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(TimerRecord);
- return 1;
- }
- forward record(playerid);
- public record(playerid)
- {
- new recordplayer = dini_Int(recordfile,"precord");
- new connecting = ConnectingOfPlayer();
- if(recordplayer < connecting)
- {
- dini_IntSet(recordfile,"precord",connecting);
- format(str,sizeof(str),"Max ever players online is: [%d]",connecting);
- SendClientMessageToAll(0x33AA33AA,str);
- } else {
- new starirecord = dini_Int(recordfile,"precord");
- format(str,sizeof(str),"Max ever player online is [%d] ",starirecord);
- SendClientMessageToAll(0x33AA33AA,str);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayerCount ++;
- TextDrawShowForPlayer(playerid, pcounter);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerCount --;
- return 1;
- }
- public ConnectingOfPlayer()
- {
- new Connected;
- for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) Connected++;
- return Connected;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement