unban command not functioning properly(SQLite)
#1

I have created an unban command using SQLite but the command would not work, also sscanf isn't being called when I don't type the name of the player, also nothing is being printed into the console after doing the command.

pawn Код:
CMD:unban(playerid, params[])
{
    new name[24], string[128], Query[500], DBResult:Result;
    if(dAdmin[playerid][USER_ADMIN] == 3)
    {
        if(sscanf(params, "s[24]", name))
        {
            SendClientMessage(playerid, -1, "[USAGE]/unban (name)");
            return 1;
        }
        format(Query, sizeof(Query), "SELECT banned FROM users WHERE username = '%s'", DB_Escape(name));
        Result = db_query(Database, Query);
        if(db_num_rows(Result))
        {
            format(Query, sizeof(Query), "UPDATE users SET banned = 0 WHERE username = '%s'", DB_Escape(name));
            Result = db_query(Database, Query);

            format(string, sizeof(string), "Player %s's ban was set to 0.", name);
            print(string);
        }
        db_free_result(Result);
        return 1;
    }
    return 1;
}
Reply


Messages In This Thread
unban command not functioning properly(SQLite) - by DarkLored - 27.08.2015, 21:57
Re: unban command not functioning properly(SQLite) - by CadSives - 27.08.2015, 22:07
Re: unban command not functioning properly(SQLite) - by Jefff - 27.08.2015, 22:16
Re: unban command not functioning properly(SQLite) - by DarkLored - 28.08.2015, 01:05

Forum Jump:


Users browsing this thread: 2 Guest(s)