Ban system - sqlite
#1

Well, I'm creating a roleplay with SQLite and I create a easy ban system to test, but this don't work.
I use as soon:
pawn Code:
public OnPlayerConnect(playerid)
{
    new DBResult:Consulta,
        Query[200]
    ;
    format(Query,sizeof(Query),"SELECT * FROM `Banidos` WHERE `NickName` = '%s'",db_escape(PlayerName(playerid)));
    Consulta = db_query(Handle, Query);
    if(db_num_rows(Consulta))
    {
        SendClientMessage(playerid,Amarelo,"SERVER:"intBranco" Vocк estб banido do servidor!");
        new str[150],
            Motivo[50],
            Admin[25],
            Data[25],
            Hora[25]
        ;
        db_get_field_assoc(Consulta,"Motivo",Motivo,50);
        db_get_field_assoc(Consulta,"Admin",Admin,25);
        db_get_field_assoc(Consulta,"DiaMesAno",Data,25);
        db_get_field_assoc(Consulta,"HoraMinutoSegundo",Hora,25);
        format(str,sizeof(str),"SERVER:"intBranco"Informaзхes: | Motivo: %s | Data: %s | Hora: %s | Admin: %s",Motivo,Data,Hora,Admin);
        SendClientMessage(playerid,Amarelo,str);
        SendClientMessage(playerid,-1,"www.site.com/forum");
        Kick(playerid);
    }
    db_free_result(Consulta);
    return 1;
}
Helpe me please, when I entered in server, nothing happens.
Reply
#2

Someone help me pls :/
Reply
#3

use

pawn Code:
printf("escaped name: %s",db_escape(PlayerName(playerid)));
here must be error
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)