SA-MP Forums Archive
Ban system - sqlite - 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 system - sqlite (/showthread.php?tid=380727)



Ban system - sqlite - Rodrigo. - 26.09.2012

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.


Re: Ban system - sqlite - Rodrigo. - 26.09.2012

Someone help me pls :/


Re: Ban system - sqlite - Jefff - 27.09.2012

use

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