SA-MP Forums Archive
Problem with mysql ban loading - 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: Problem with mysql ban loading (/showthread.php?tid=644427)



Problem with mysql ban loading - Kubad - 07.11.2017

Hello i have problem with mysql ban checking i tried some code from this forum but still didnt work and my mysql connect work but checking not btw sorry for my english

PHP код:
public OnPlayerConnect(playerid)
{
    new 
query[256];
    
format(query,sizeof(query),"SELECT * FROM Bans WHERE PlayerName='%s' or IP='%s'",Name(playerid),IP);
    
mysql_query(handle,query);
    if(
cache_num_rows() > 0)
    {
        
        
cache_get_value_name_int(0, "Time", time);
        
cache_get_value_name(0, "Admin", admin);
        
cache_get_value_name(0, "PlayerName", pname);
        
cache_get_value_name(0, "Reason", string1);
        
printf("%d %s %s %s",time,admin,pname,string1);
        new 
string[50], str[50], str1[100], str2[100];
        
format(string, sizeof(string),"By Admin: %s", admin);
        
format(str, sizeof(str),"banned account: %s", pname);
        
format(str1, sizeof(str1),"reason: %s", string1);
        
format(str1, sizeof(str2),"when: %d timestamp", time);
        
SendClientMessage(playerid, ADMIN_COLOR,"you are banned");
        
SendClientMessage(playerid, ADMIN_COLOR, str);
        
SendClientMessage(playerid, ADMIN_COLOR, string);
        
SendClientMessage(playerid, ADMIN_COLOR, str1);
        
SendClientMessage(playerid, ADMIN_COLOR, str2);
        
KickPlayer(playerid);
    } 



Re: Problem with mysql ban loading - Kubad - 07.11.2017

okay sorry i know where is problem thank you for reading


Re: Problem with mysql ban loading - masuzaron - 07.11.2017

Are you using ban system with R40+ mysql plugin? (https://github.com/pBlueG/SA-MP-MySQL/releases)