Help [Banned] +Rep
#1

Hello

i have problem in my GM when i join in Server is say me "Your IP is banned on this server" Post a unban request , and other players is have example this Problem

code
pawn Код:
MySQLCheckConnection();
        ClearCrime(playerid);
        ClearFishes(playerid);
        ClearCooking(playerid);
        ClearGroceries(playerid);
        ClearMarriage(playerid);
        GetPlayerName(playerid, plname, sizeof(plname));
        SetPlayerColor(playerid, COLOR_GRAD2);
        new playersip[256];
        GetPlayerIp(playerid,playersip,sizeof(playersip));
        new quer[256];
        format(quer, sizeof(quer), "SELECT * FROM banuri WHERE TIP=2 AND PlayerIP='%s'", playersip);
        mysql_query(quer);
        mysql_store_result();
        if(mysql_num_rows()!=0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Your IP is banned on this server");
            SendClientMessage(playerid, COLOR_GREY, "Post a unban request on forum");
            SetTimerEx("Kicka", 2000, 0, "d", playerid);
            return 1;
        }
        new sqlaccountstatus = MySQLCheckAccount(plname);
        if(sqlaccountstatus != 0)
        {
            /*if(MySQLCheckIPBanned(playerid, sqlaccountstatus, pip) != 0)
            {
                new string[128];
                format(string, sizeof(string), "Contul tau este banat permanent de catre adminul %s, reason: %s.",PlayerData[playerid][pAdminBan],PlayerData[playerid][pBanReason]);
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                format(string, sizeof(string), "IP-ul tau este: %s", pip);
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                SendClientMessage(playerid, COLOR_WHITE, "To unban visit {B20000}forum");
                Kick(playerid);
                return 0;
            }*/

            if(MySQLCheckAccountLocked(sqlaccountstatus, playerid) != 0)
            {
                if(PlayerData[playerid][pBanaP] == 0)
                {
                    new string[128];
                    format(string, sizeof(string), "Your account was permanently banned by admin %s, reason: %s.",PlayerData[playerid][pAdminBan],PlayerData[playerid][pBanReason]);
                    SendClientMessage(playerid, COLOR_LIGHTRED, string);
                    SendClientMessage(playerid, COLOR_WHITE, "To unban visit  forum");
                    SetTimerEx("Kicka", 2000, 0, "d", playerid);
                    return 0;
                }
                else if(PlayerData[playerid][pBanaP] != 0)
                {
                    new zero1[5];
                    new zero2[5];
                    new zero3[5];
                    new zero4[5];
                    new year, month,day;
                    getdate(year, month, day);
                    if(PlayerData[playerid][pBanaP] <= year)
                    {
                        if(PlayerData[playerid][pBanaP] < year)
                        {
                            new query[128];
                            PlayerData[playerid][pLocked] = 0;
                            format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
                            mysql_query(query);
                            format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
                            mysql_query(query);
                        }
                        else if(PlayerData[playerid][pBanaP] == year)
                        {
                            if(PlayerData[playerid][pBanlP] < month)
                            {
                                new query[128];
                                PlayerData[playerid][pLocked] = 0;
                                format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
                                mysql_query(query);
                                format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
                                mysql_query(query);
                            }
                            else if(PlayerData[playerid][pBanlP] == month)
                            {
                                if(PlayerData[playerid][pBanzP] < day)
                                {
                                    new query[128];
                                    PlayerData[playerid][pLocked] = 0;
                                    format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
                                    mysql_query(query);
                                    format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
                                    mysql_query(query);
                                }
                                else if(PlayerData[playerid][pBanzP] == day)
                                {
                                    new hour,minute,second;
                                    gettime(hour,minute,second);
                                    if(PlayerData[playerid][pBanoP] < hour)
                                    {
                                        new query[128];
                                        PlayerData[playerid][pLocked] = 0;
                                        format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
                                        mysql_query(query);
                                        format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
                                        mysql_query(query);
                                    }
                                    else if(PlayerData[playerid][pBanoP] == hour)
                                    {
                                        if(PlayerData[playerid][pBanmP] < minute)
                                        {
                                            new query[128];
                                            PlayerData[playerid][pLocked] = 0;
                                            format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
                                            mysql_query(query);
                                            format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
                                            mysql_query(query);
                                        }
                                        else
                                        {
                                            new string[128];
                                            if(PlayerData[playerid][pBanoP] < 10)
                                            {
                                                zero1 = "0";
                                            }
                                            if(PlayerData[playerid][pBanmP] < 10)
                                            {
                                                zero2 = "0";
                                            }
                                            if(PlayerData[playerid][pBanzP] < 10)
                                            {
                                                zero3 = "0";
                                            }
                                            if(PlayerData[playerid][pBanlP] < 10)
                                            {
                                                zero4 = "0";
                                            }
                                            format(string, sizeof(string), "Your account is Banned by Admin: %s, pana %s%d/%s%d/%d ora %s%d:%s%d, reason: %s.",PlayerData[playerid][pAdminBan],zero3,PlayerData[playerid][pBanzP],zero4,PlayerData[playerid][pBanlP],PlayerData[playerid][pBanaP],zero1,PlayerData[playerid][pBanoP],zero2,PlayerData[playerid][pBanmP],PlayerData[playerid][pBanReason]);
                                            SendClientMessage(playerid, COLOR_LIGHTRED, string);
                                            SendClientMessage(playerid, COLOR_WHITE, "To unban visit forum");
                                            SetTimerEx("Kicka", 2000, 0, "d", playerid);
                                            return 0;
Reply
#2

Your banlist is empty ?
Reply
#3

Are you sure you don't have any row in the table "banuri" that contains your ip?
Reply
#4

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Your banlist is empty ?
yes i see banlist , is no ban , and i tested it with my Friend , he is have exact me
Reply
#5

Quote:
Originally Posted by Koala818
Посмотреть сообщение
Are you sure you don't have any row in the table "banuri" that contains your ip?
no dude List ban ip is empty , and my friend is have exact this problem when he enter
Reply
#6

If you're using mysql_debug(1); can you try to connect to the server and then post here the content of mysql_debug.txt file?
Reply
#7

Quote:
Originally Posted by Koala818
Посмотреть сообщение
If you're using mysql_debug(1); can you try to connect to the server and then post here the content of mysql_debug.txt file?
where this : mysql_debug ? , i don"t find any mysql_debug (
Reply
#8

You must enable this.

After you connect to the mysql server (mysql_connect(...)) you put "mysql_debug(1);" so you enable the debugging. This creates automatically a file named "Debug.txt" in your samp server directory that tells you exactly what comes and what goes from/to the database.
Reply
#9

Quote:
Originally Posted by Koala818
Посмотреть сообщение
You must enable this.

After you connect to the mysql server (mysql_connect(...)) you put "mysql_debug(1);" so you enable the debugging. This creates automatically a file named "Debug.txt" in your samp server directory that tells you exactly what comes and what goes from/to the database.
ok, done
Reply
#10

pawn Код:
forward ConnectMySQL();
    PlayGaming ConnectMySQL()
    {
        if(mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS))
        {
            printf("[MYSQL]: Connection to `%s` succesful!",SQL_DB);
            mysql_debug(1);
        }
        else
        {
          printf("[MYSQL]: [ERROR]: Connection to `%s` failed!",SQL_DB);
        }
        return 1;
    }

    /*PlayGaming MySQLDisconnect()
    {
        mysql_close();
        return 1;
    }*/


    forward MYSQLBANAT(sqlvalname[], sqlresult[]);
    NiGamig MYSQLBANAT(sqlvalname[], sqlresult[])
    {
        new query[128];
        format(query, sizeof(query), "SELECT Locked FROM players WHERE Name = %d LIMIT 1", sqlvalname);
        mysql_query(query);
        mysql_store_result();
        if(mysql_fetch_row(sqlresult)==1)
        {
            return 1;
        }
        return 0;
    }
L.E: Ok, and doest it shows something wrong in Debug.txt? Like errors, or values that does not correspond?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)