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


Messages In This Thread
Ban system - sqlite - by Rodrigo. - 26.09.2012, 18:50
Re: Ban system - sqlite - by Rodrigo. - 26.09.2012, 22:02
Re: Ban system - sqlite - by Jefff - 27.09.2012, 00:45

Forum Jump:


Users browsing this thread: 1 Guest(s)