07.11.2017, 17:03
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);
}