Ban list for Y_ini
#1

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.
Reply
#2

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);
}
Reply
#3

I want list with ban time, ban reason...
Reply
#4

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

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

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);
}
Reply
#7

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

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.
Reply
#9

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..
Reply
#10

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)