Help pl0x:
#1

pawn Код:
#include <a_samp>
#include <dini>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define C_RED   (0xFF0000FF)
#define C_GREEN (0x00FF00FF)
#define C_BLUE  (0x0000FFFF)

#define NICK_BAN_FILE  "ban.txt"


public OnFilterScriptInit()
{
    if (!dini_Exists(NICK_BAN_FILE))
    {
        dini_Create(NICK_BAN_FILE);
    }

    return 1;
}
public OnPlayerConnect(playerid)
{
    new ip[40];
    GetPlayerIp(playerid, ip, 16);
    ahx_playerIP[playerid] = ip;
    ahx_playerMoney[playerid] = 0;
    if (NICK_BAN)
    {
        if (dini_Int(NICK_BAN_FILE, ahx_PlayerName(playerid)) == 1)
        {
            ahx_FAddLogEntry("Player %s banned for ban evading", ahx_PlayerName(playerid));
            ahx_BanPlayerIpEx(playerid, "Ban evading");
        }
    }
    return 1;
}
I want that if the player or the IP (Normal / Range ) is in ban.txt (Ban log) Then auto ban the player, but I get some mistakes :S
Please help
Reply
#2

Quote:
Originally Posted by RULES
b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 48 hours old, and it needs to have useful information about your problem.
Thanks for your impatience.
Reply
#3

you would want to read through the ban file and compare the lines to the name/ip and if it gets a hit then ban them.
Go to the wiki and look for some topics about how to read files.
Here's some links if you'r too lazy to search. (Not saying your a lazy person, we all get lazy at times :P)
https://sampwiki.blast.hk/wiki/Fclose
https://sampwiki.blast.hk/wiki/Fread
https://sampwiki.blast.hk/wiki/Fopen
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)