mysql help
#1

How to make this threaded?

pawn Код:
CMD:banacc(playerid, params[])
{
    if(PVar[playerid][pLevel] >= 1)
    {
        new Player[MAX_PLAYER_NAME], querySz[256], reason[40];
        if(sscanf(params,"s[24]s[40]",Player, reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /banacc [exact name] [Reason] (offline ban)");

        format(querySz, sizeof(querySz), "SELECT user FROM playerinfo WHERE user = '%s'", Player);
        mysql_query(querySz);
        mysql_store_result();
        if(mysql_num_rows() == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Error: No account with that name.");
            mysql_free_result();
            return 1;
        }
        format(querySz, sizeof(querySz), "UPDATE playerinfo SET Banned = 1 WHERE user = '%s'", Player);
        mysql_query(querySz);
        mysql_free_result();

        format(querySz, sizeof(querySz), "[AdminInfo]{FFFFFF} %s has banned %s's account. Reason: %s", PVar[playerid][pAdminRank], Player, reason);
        SendAdminMessage(COLOR_YELLOW,querySz);
    }
    return 1;
}
Reply
#2

Read the documentation of the MySQL plugin you're using.
It's probably in there somewhere, and if not it isn't supported.
Reply
#3

im using the R6 plugin from BlueG, i want to make script ready for R7 version. But there is nothing on wiki yet, thats why i ask for help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)