Online Players with Recorder.
#1

Hello, i was want to asking how to make an recorder for server which including TextDraw not msgs Clients , so if players was 15 and got 16 the new record will be 16 , and also showing online players: Online Players: %d


Shortly , When you connect to a server or a new record shows the maximum recorded number of players TextDraw Under the Money of the Game

I got this but its not with textdraw i failed to make an textdraw
CODE:
Код:
/*
Online Players Record v2 by AirKite
*/
#include <a_samp>
new oplayers, Precord, Drecord, Mrecord, Yrecord, THrecord, TMrecord;
new mname[][] = {"January", "February", "March", "April", "May", "June", "July", "Augusta", "September", "Otktyabrya", "November", "December"};
public OnFilterScriptInit()
{
	LoadRecord();
	oplayers=ConnectedPlayers();
	print("\n--------------------------------------");
	print("FS =Online Players Record= by Airkite, Loaded...");
	print("--------------------------------------\n");
	return 1;
}
public OnFilterScriptExit()
{
    print("\n--------------------------------------");
	print("FS =Online Players Record= by Airkite, Unloaded...");
	print("--------------------------------------\n");
	return 1;
}
public OnPlayerConnect(playerid)
{
	if(IsPlayerNPC(playerid)) { return 1; }
	SetTimerEx("Record", 5000, false, "d", playerid);
	return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    oplayers--;
	return 1;
}
///////////////////////////////////////////////////////////////////////////
forward LoadRecord();
public LoadRecord()
{
	new strFromFile[24], arrCoords[6][5], File: file = fopen("porecords", io_read);
	if (file)
	{
		fread(file, strFromFile);
		split(strFromFile, arrCoords, ',');
		Precord = strval(arrCoords[0]);
		Drecord = strval(arrCoords[1]);
		Mrecord = strval(arrCoords[2]);
		Yrecord = strval(arrCoords[3]);
		THrecord = strval(arrCoords[4]);
		TMrecord = strval(arrCoords[5]);
		fclose(file);
	}
	return 1;
}
forward SaveRecord();
public SaveRecord()
{
	new coordsstring[24];
	format(coordsstring, sizeof(coordsstring), "%d,%d,%d,%d,%d,%d", Precord, Drecord, Mrecord, Yrecord, THrecord, TMrecord);
	new File: file = fopen("porecords", io_write);
	fwrite(file, coordsstring);
	fclose(file);
	return 1;
}
forward Record(playerid);
public Record(playerid)
{
	if(Precord)
	{
		new string[92];
		format(string, sizeof(string), "**Record for online players %d, fixed on %d %s %d, at %d:%d", Precord, Drecord, mname[Mrecord-1], Yrecord, THrecord, TMrecord);
		SendClientMessage(playerid, 0xA5D24DFF, string);
	}
	oplayers++;
    if(Precord < oplayers)
    {
        Precord=oplayers;
        gettime(THrecord, TMrecord); getdate(Yrecord, Mrecord, Drecord);
        new string[92];
		format(string, sizeof(string), "*New record for online players %d, fixed on %d %s %d, at %d:%d", Precord, Drecord, mname[Mrecord-1], Yrecord, THrecord, TMrecord);
        SendClientMessageToAll(0xFCB833FF, string);
        SaveRecord();
    }
	return 1;
}
stock split(const strsrc[], strdest[][], delimiter)
{
    new i, li;
    new aNum;
    new len;
    while(i <= strlen(strsrc))
    {
        if(strsrc[i] == delimiter || i == strlen(strsrc))
        {
            len = strmid(strdest[aNum], strsrc, li, i, 128);
            strdest[aNum][len] = 0;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return 1;
}
forward ConnectedPlayers();
public ConnectedPlayers()
{
	new Connected;
	for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && !IsPlayerNPC(i)) Connected++;
	return Connected;
}
///////////////////////////////////////////////////////////////////////////
Thanks, +Reps!
Reply


Messages In This Thread
Online Players with Recorder. - by MahdiGames - 30.12.2013, 11:15
Re: Online Players with Recorder. - by Raza2013 - 30.12.2013, 11:17
Re: Online Players with Recorder. - by MahdiGames - 30.12.2013, 11:33
Re: Online Players with Recorder. - by Vykintas - 30.12.2013, 12:01
Re: Online Players with Recorder. - by MahdiGames - 30.12.2013, 12:03
Re: Online Players with Recorder. - by MahdiGames - 30.12.2013, 12:10
Re: Online Players with Recorder. - by Vykintas - 30.12.2013, 12:19
Re: Online Players with Recorder. - by MahdiGames - 30.12.2013, 16:02
Re: Online Players with Recorder. - by ic3cr3am - 30.12.2013, 17:14
Re: Online Players with Recorder. - by MahdiGames - 30.12.2013, 17:30

Forum Jump:


Users browsing this thread: 1 Guest(s)