SA-MP Forums Archive
Command que Checks Log \ Folder. +rep - 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: Command que Checks Log \ Folder. +rep (/showthread.php?tid=583653)



Command que Checks Log \ Folder. +rep - iTakelot - 29.07.2015

How can I make a command that checks folders in scriptfiles
ex:

Type / Accounts and it sends me the names that have inside the folder accounts.

-Izaque_.

- [T] akelot

-Sr.Bull

So preciso de um exemplo.


Re: Command que Checks Log \ Folder. +rep - iTakelot - 29.07.2015

up...?


Re: Command que Checks Log \ Folder. +rep - jamesmith12 - 30.07.2015

up i also need this


Re: Command que Checks Log \ Folder. +rep - SoFahim - 30.07.2015

Quote:
Originally Posted by jamesmith12
Посмотреть сообщение
up i also need this
Use MySql and also php . Without them, you cannot


Re: Command que Checks Log \ Folder. +rep - MasonSFW - 30.07.2015

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.