27.09.2012, 21:27
I created a ban system with SQLite, however the CheckBan don't work.
PS: I put in OnPlayerConnect!!!
Code:
Please, someone help me!
I've tried everything.
When I enter the server nothing happens
PS: I put in OnPlayerConnect!!!
Code:
pawn Код:
CheckBan(playerid)
{
new DBResult:Resultado,
Query[200],
pIp[25]
;
GetPlayerIp(playerid, pIp, sizeof(pIp));
format(Query,sizeof(Query),"SELECT * FROM `Banidos` WHERE `IP` = '%s'", pIp);
Resultado = db_query(Handle, Query);
if(db_num_rows(Resultado) != 0)
{
SendClientMessage(playerid,Amarelo,"SERVER:"intBranco" Vocк estб banido do servidor!");
new str[150],
Campo[50]
;
db_get_field_assoc(Resultado,"Motivo",Campo,50);
format(pInfo[playerid][pBanMotivo],50, Campo);
db_get_field_assoc(Resultado,"Admin",Campo,50);
format(pInfo[playerid][pBanAdmin],25, Campo);
db_get_field_assoc(Resultado,"DiaMesAno",Campo,50);
format(pInfo[playerid][pBanData],30, Campo);
db_get_field_assoc(Resultado,"HoraMinutoSegundo",Campo,50);
format(pInfo[playerid][pBanHora],30, Campo);
format(str,sizeof(str),"SERVER:"intBranco"Informaзхes: | Motivo: %s | Data: %s | Hora: %s | Admin: %s",
pInfo[playerid][pBanMotivo],
pInfo[playerid][pBanData],
pInfo[playerid][pBanHora],
pInfo[playerid][pBanAdmin]
);
SendClientMessage(playerid,Amarelo,str);
SendClientMessage(playerid,-1,"Nosso site: www.site.com/forum");
Kick(playerid);
}
db_free_result(Resultado);
return 1;
}
I've tried everything.
When I enter the server nothing happens