MYSQL Ban Check
#2

It would be something like:
pawn Код:
new query[126];
    format(query,sizeof(query),"SELECT * FROM table_bans WHERE Name='%s'",playername);
    mysql_query(mysql,query);
    if(cache_num_rows() > 0)
    {
        new banstring[256];
        new bName[30],bIP[30],bAdmin[30],bReason[30];
                cache_get_field_content(0,"Name",bName);
        cache_get_field_content(0,"IP",bIP);
        cache_get_field_content(0,"Admin",bAdmin);
        cache_get_field_content(0,"Reason",bReason);
        format(banstring,sizeof(banstring),"Name: %s\nIP: %s\nAdmin: %s\nReason: %s",bName,bIP,bAdmin,bReason);
        ShowPlayerDialog(playerid,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"Account Banned",banstring,"Aceptar","");
        Kick(playerid);
    }
I'm not very sure about function cache_num_rows, but try it., but try it.

sorry for my bad english.
Reply


Messages In This Thread
MYSQL Ban Check - by theonethatownz - 25.03.2016, 10:49
Respuesta: MYSQL Ban Check - by mcreed - 25.03.2016, 19:18

Forum Jump:


Users browsing this thread: 2 Guest(s)