SA-MP Forums Archive
Ban list for Y_ini - 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: Ban list for Y_ini (/showthread.php?tid=580539)



Ban list for Y_ini - bigboy81 - 06.07.2015

I know lot of server have ban list, but same as using y_ini file system, not Mysql.
I searching that for y_ini but i don't find anything.
I want make ban list when player was banned that information showing on page.


Re: Ban list for Y_ini - dusk - 06.07.2015

What kind of a list are you talking about?

Somewhat like this:
Quote:

Name
Name2
Name3

If so, there's not much point in using y_ini. Y_ini uses key/value pairs and they are not needed if I understand your situation.

You could just do something like:

pawn Код:
stock BanPlayer(playerid)
{
    Ban(playerid);
    new name[ MAX_PLAYER_NAME ];
    GetPlayerName(playerid, name, sizeof(name));
    new File:file = fopen("bans.ini", io_append);
    if(file)
    {
         fwrite(file, name);
         fwrite(file, "\r\n");
    }
    fclose(file);
}



Re: Ban list for Y_ini - bigboy81 - 06.07.2015

I want list with ban time, ban reason...


Re: Ban list for Y_ini - dusk - 06.07.2015

In that case you probably will need y_ini then. You want all of them in one file?


Re: Ban list for Y_ini - bigboy81 - 06.07.2015

Yes i using Y_ini, and i think that is possible to do in one file.
I need some example..


Re: Ban list for Y_ini - dusk - 06.07.2015

Well if you are going to use Time and Reason as keys, I would suggest using splitting the file into sections(y_ini has support for that) where each section would be named after the player.


pawn Код:
stock BanPlayer(playerid, reason[])
{
    new INI:file = INI_Open("bans.ini"),
          name[MAX_PLAYER_NAME],
          string[64];
 
    GetPlayerName(playerid, name, sizeof(name));
    INI_SetTag(ini, name);
    INI_WriteString(ini, "Name", name);
    INI_WriteString(ini, "Reason", reason);
    // You can use a simple timestamp, but I assume you will want a understable date format
    new year, month, day, hour, minute, second;
    getdate(year, month, day);
    gettime(hour, minute, second);
    format(string, sizeof(string), "%d.%d.%d %d:%d:%d", year, month, day, hour, minute, second);
    INI_WriteString(ini, "Date", string);
    INI_Close(ini);
}



Re: Ban list for Y_ini - bigboy81 - 06.07.2015

I want something like this
http://sampdm.net/banlist.php


Re: Ban list for Y_ini - dusk - 06.07.2015

That's more than a simple text file. You will need to store the data, that can be some sort of database or even a text file. Then you will need html and PHP knowledge to create that kind of file.

I can't know how it works, but if even if it stores the data in text files, you will still need PHP to create the search.


Re: Ban list for Y_ini - bigboy81 - 06.07.2015

Do you know which php or html reader is good for reading that stored file..
I found some ftp php which reading all things from samp.ban, but in samp.ban we don't have ban reason or ban date..
Only ip if im correct..


Re: Ban list for Y_ini - dusk - 06.07.2015

What do you mean by "php or html reader" ?

No, Samp.ban contains date and time aswell. More info here.