SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/09/2012, 07:50 PM   #1
Rodrigo.
Big Clucker
 
Rodrigo.'s Avatar
 
Join Date: May 2011
Posts: 129
Reputation: 3
Default Ban system - sqlite

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.
Rodrigo. is offline   Reply With Quote
Old 26/09/2012, 11:02 PM   #2
Rodrigo.
Big Clucker
 
Rodrigo.'s Avatar
 
Join Date: May 2011
Posts: 129
Reputation: 3
Default Re: Ban system - sqlite

Someone help me pls :/
Rodrigo. is offline   Reply With Quote
Old 27/09/2012, 01:45 AM   #3
Jefff
Banned
 
Join Date: Dec 2007
Posts: 2,594
Reputation: 326
Default Re: Ban system - sqlite

use

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

here must be error
Jefff is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLite Ban System Hervest1998 Scripting Help 7 28/07/2012 03:14 PM
[FilterScript] LorencBank (SQLite Bank system) Lorenc_ Filterscripts 18 13/01/2012 06:11 PM
[FilterScript] zXy_Fights System |SQLite| ZmaXy Filterscripts 1 26/12/2011 05:29 PM
Sqlite Vehicle System Bugging Norn Help Archive 3 02/10/2010 01:42 AM


All times are GMT. The time now is 02:13 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.