25.03.2013, 07:38
(
Последний раз редактировалось FunnyBear; 25.03.2013 в 15:54.
)
Hello,
I just recently added a new MySQL ban system to my server. It works, but theres a problem. When I banned a person, they can still join and play on the server when they reconnect. I tried to fix it, but I can't seem to find the problem@
Under onplayerconnect I have this:
So here is my problem. I tried banning myself, and the data goes to the database. But If I connect again, it just continues to play! So the ban is not loading! Please help
Please help me! Thanks
I just recently added a new MySQL ban system to my server. It works, but theres a problem. When I banned a person, they can still join and play on the server when they reconnect. I tried to fix it, but I can't seem to find the problem@
pawn Код:
stock CheckBan(playerid)
{
new query[126], IP[16];
GetPlayerIp(playerid, IP, sizeof(IP));
format(query,sizeof(query),"SELECT * FROM 'bans' WHERE ('Name' = '%s' OR 'IP' = '%s') AND 'Status' = 1", GetName(playerid), IP );
mysql_query(query);
mysql_store_result();
new rows = mysql_num_rows();
if(rows == 1)
{
new bReason[128], bannedBy[MAX_PLAYER_NAME], Dialog[128];
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(bReason, "Reason");
mysql_fetch_field_row(bannedBy, "BannedBy");
format(Dialog, sizeof(Dialog), "{FF0000}You are banned from this server! \n{FF0000}Name:{FFFFFF} %s \n{FF0000}Reason:{FFFFFF} %s \n{FF0000}Banned By:{FFFFFF} %s", GetName(playerid), bReason, bannedBy);
ShowPlayerDialog(playerid, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "{FF0000}Banned", Dialog, "Close", "");
}
return 1;
}
mysql_free_result();
return 0;
}
pawn Код:
CheckBan(playerid);
Please help me! Thanks