Unblock bugs
#1

pawn Код:
command(unblock, playerid, params[])
{
    new string[128], Name[128];
    if(sscanf(params, "z", Name))
    {
        if(Player[playerid][AdminLevel] >= 6)
        {
            SendClientMessage(playerid, WHITE, "SYNTAX: /unblock [Name]");
            SendClientMessage(playerid, GREY, "NOTE: This command is CaSe SeNsItIvE.");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 6)
        {
            if(strlen(Name) >= 3 && strlen(Name) < MAX_PLAYER_NAME+1)
            {
                format(string, sizeof(string), "Accounts/%s.ini", Name);
                if(fexist(string))
                {
                    if(dini_Int(string, "Banned") == 2)
                    {
                        dini_IntSet(string, "Banned", -1);
                        format(string, sizeof(string), "INFO: %s has unblocked %s", GetName(playerid), Name);
                        UnBlockLog(string);
                        SCM(playerid, YELLOW, string);
                    }
                }
                else
                {
                    SendClientMessage(playerid, WHITE, "Account not found.");
                }
            }
        }
    }
    return 1;
}
It doesn't send me the message from unblocked.
And it doesn't unblock the player...
Reply
#2

change the bigger sign after "else"u Put the 2 of the as the same (sorry on my phone hope u get it)
Reply
#3

Can you Explain kinda better, I dont get what you mean :P
Reply
#4

Try this
pawn Код:
command(unblock, playerid, params[])
{
    if(Player[playerid][AdminLevel] < 6) return true;

    new Name[32];
    if(sscanf(params, "s[32]", Name))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /unblock [Name]");
        return SendClientMessage(playerid, GREY, "NOTE: This command is CaSe SeNsItIvE.");
    }

    if(strlen(Name) >= 3 && strlen(Name) < MAX_PLAYER_NAME+1)
    {
        new string[64];
        format(string, sizeof(string), "Accounts/%s.ini", Name);
        if(!fexist(string)) return SendClientMessage(playerid, WHITE, "Account not found.");

        if(dini_Int(string, "Banned") == 2)
        {
            dini_IntSet(string, "Banned", -1);
            format(string, sizeof(string), "INFO: %s has unblocked %s", GetName(playerid), Name);
            UnBlockLog(string);
            SCM(playerid, YELLOW, string);
        }
    }
    return true;
}
Reply
#5

^ xd
Reply
#6

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Try this
pawn Код:
command(unblock, playerid, params[])
{
    if(Player[playerid][AdminLevel] < 6) return true;

    new Name[32];
    if(sscanf(params, "s[32]", Name))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /unblock [Name]");
        return SendClientMessage(playerid, GREY, "NOTE: This command is CaSe SeNsItIvE.");
    }

    if(strlen(Name) >= 3 && strlen(Name) < MAX_PLAYER_NAME+1)
    {
        new string[64];
        format(string, sizeof(string), "Accounts/%s.ini", Name);
        if(!fexist(string)) return SendClientMessage(playerid, WHITE, "Account not found.");

        if(dini_Int(string, "Banned") == 2)
        {
            dini_IntSet(string, "Banned", -1);
            format(string, sizeof(string), "INFO: %s has unblocked %s", GetName(playerid), Name);
            UnBlockLog(string);
            SCM(playerid, YELLOW, string);
        }
    }
    return true;
}
After I typed the whole command it says
Код:
[20:33:52] SYNTAX: /unblock [Name]

[20:33:52] NOTE: This command is CaSe SeNsItIvE.
Just the reminding thing again.
Reply
#7

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Try this
pawn Код:
command(unblock, playerid, params[])
{
    if(Player[playerid][AdminLevel] < 6) return true;

    new Name[32];
    if(sscanf(params, "s[32]", Name))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /unblock [Name]");
        return SendClientMessage(playerid, GREY, "NOTE: This command is CaSe SeNsItIvE.");
    }

    if(strlen(Name) >= 3 && strlen(Name) < MAX_PLAYER_NAME+1)
    {
        new string[64];
        format(string, sizeof(string), "Accounts/%s.ini", Name);
        if(!fexist(string)) return SendClientMessage(playerid, WHITE, "Account not found.");

        if(dini_Int(string, "Banned") == 2)
        {
            dini_IntSet(string, "Banned", -1);
            format(string, sizeof(string), "INFO: %s has unblocked %s", GetName(playerid), Name);
            UnBlockLog(string);
            SCM(playerid, YELLOW, string);
        }
    }
    return true;
}
Can you check my Reply it bugs :P
Reply
#8

Use this and show me the results of debug
pawn Код:
command(unblock, playerid, params[])
{
    if(Player[playerid][AdminLevel] < 6) return true;

    new Name[32];
    print("Debug : 1");
    if(sscanf(params, "s[32]", Name))
    {
        print("Debug : 2");
        SendClientMessage(playerid, WHITE, "SYNTAX: /unblock [Name]");
        return SendClientMessage(playerid, GREY, "NOTE: This command is CaSe SeNsItIvE.");
    }

    if(strlen(Name) >= 3 && strlen(Name) < MAX_PLAYER_NAME+1)
    {
        print("Debug : 3");
        new string[64];
        format(string, sizeof(string), "Accounts/%s.ini", Name);
        if(!fexist(string)) return SendClientMessage(playerid, WHITE, "Account not found.");

        print("Debug : 4");
        printf("Debug : %s",Name);
        if(dini_Int(string, "Banned") == 2)
        {
            print("Debug : 5");
            dini_IntSet(string, "Banned", -1);
            format(string, sizeof(string), "INFO: %s has unblocked %s", GetName(playerid), Name);
            UnBlockLog(string);
            SCM(playerid, YELLOW, string);
        }
    }
    return true;
}
Reply
#9

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Use this and show me the results of debug
pawn Код:
command(unblock, playerid, params[])
{
    if(Player[playerid][AdminLevel] < 6) return true;

    new Name[32];
    print("Debug : 1");
    if(sscanf(params, "s[32]", Name))
    {
        print("Debug : 2");
        SendClientMessage(playerid, WHITE, "SYNTAX: /unblock [Name]");
        return SendClientMessage(playerid, GREY, "NOTE: This command is CaSe SeNsItIvE.");
    }


    if(strlen(Name) >= 3 && strlen(Name) < MAX_PLAYER_NAME+1)
    {
        print("Debug : 3");
        new string[64];
        format(string, sizeof(string), "Accounts/%s.ini", Name);
        if(!fexist(string)) return SendClientMessage(playerid, WHITE, "Account not found.");

        print("Debug : 4");
        printf("Debug : %s",Name);
        if(dini_Int(string, "Banned") == 2)
        {
            print("Debug : 5");
            dini_IntSet(string, "Banned", -1);
            format(string, sizeof(string), "INFO: %s has unblocked %s", GetName(playerid), Name);
            UnBlockLog(string);
            SCM(playerid, YELLOW, string);
        }
    }
    return true;
}
Im in bed right now tomorrow you got the result, where should i find the result? In chat or where?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)