SA-MP Forums Archive
Ban - MySQL. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ban - MySQL. (/showthread.php?tid=450271)



Ban - MySQL. - Darnell - 12.07.2013

I'm sorry with opening all these threads, but I just don't get how to make a ban system with MySQL.
I tried, and this is what I have so far,
The variables:
pawn Код:
pBannedIP,
    pBannedReason,
    pBannedBy,
The command:
pawn Код:
COMMAND:ban(playerid, params[]) {
        new
            string[250],
            target;
        getdate(D, M, Y);
        if(PlayerInfo[playerid][pAdmin] < 1) return S(playerid, RED, NOADMIN);
        if(sscanf(params, "us[128]", target, params)) return S(playerid, WHITE, "[Parameters]: /ban (playerid) (reason)");
        format(string, sizeof(string), "Server action: %s has been banned by %s, reason: %s (%d/%d/%d)", GN(target), GN(playerid), params, D, M, Y);
        SA(0xff000000, string);
        return true;
}
I'm not sure how can I select the query, then update it, I don't remember and can't find it, if you can either explain it step by step or send a tutorial, I'd be gratful.


Re: Ban - MySQL. - Darnell - 12.07.2013

This is a scripting help forum after all.
I've seen many threads asking for MySQL help and people help them without saying anything or what so ever.


Re: Ban - MySQL. - Darnell - 12.07.2013

It is regarding PAWN scripting, I am scripting in PAWN and I require assistance due my lack of knowledge.


Re: Ban - MySQL. - Darnell - 12.07.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
If your question truly is a PAWN question then the answer is very simple:

pawn Код:
mysql_function_query()
That is how you run update and select queries from PAWN.
Yeah, but, I gotta format it first, but I'm not sure about it
pawn Код:
format(query, sizeof(query),"UPDATE `bans`...");
I don't remember how to do it.


Re: Ban - MySQL. - Ronaldo_raul™ - 12.07.2013

Mind reading the release thread ? (If you're using BlueG MySQL plugin.)