pawn Код:
RecordPlayerAccount(playerid); // Put this under your callback when player registered, It will record player name to file
stock RecordPlayerAccount(targetid)
{
new day, month, year, second, minute, hour;
new filename[128], str[128];
gettime(hour, minute, second);
getdate(year, month, day);
format(filename, sizeof(filename), "Account/AccountsList.txt", pName(targetid));
if(!fexist("Account/AccountsList.txt"))
{
fcreate(filename);
}
new File: file = fopen(filename, io_append);
format(str, sizeof(str), "[Joint Date] [%i/%i/%i] [%i:%i:%i]: %s\r\n", day, month, year, hour, minute, second, pName(targetid));
fwrite(file, str);
fclose(file);
return 1;
}
//Command to appear accounts list
CMD:accountlist(playerid, params[])
{
new str[128], tmp[128], total;
if(fexist("Account/AccountsList.txt"))
{
format(str, sizeof(str), "Account/AccountsList.txt");
new string[128], File: file = fopen(str, io_read);
while(fread(file, string))
{
total ++;
format(string, sizeof(string), "%s", string);
SendClientMessage(playerid, -1, string);
}
}
format(tmp, sizeof(tmp), "Total Player Account: %d Accounts", total);
SendClientMessage(playerid, -1, tmp);
return 1;
}
Screen:
Hope you use this.