12.07.2014, 03:41
Well. I want to make a ban system, everything works fine for now, but one thing. The ban reason is not shown.
I'm still confused about where the problem happens, ...
Here are the codes from where the ban reason is processed.
Hope you can help :P
I'm still confused about where the problem happens, ...
Here are the codes from where the ban reason is processed.
pawn Код:
enum ban_data
{
ban_rd,
ban_rh,
ban_reason[64]
}
pawn Код:
stock BAN_GETDATA(playerid, data[ban_data])
{
(...)
mysql_format(BAN_DB, tQuery, sizeof tQuery, "SELECT `Reason` FROM `Bans` WHERE `IP` = '%s' AND `BanIP` != '0'", IP);
mysql_query(BAN_DB, tQuery);
CA = cache_save(BAN_DB);
cache_get_row(0, 0, data[ban_reason], BAN_DB);
cache_delete(CA, BAN_DB);
(...)
}
pawn Код:
public OnPlayerConnect(playerid)
{
(...)
mysql_reconnect(BAN_DB);
if (BAN_CHECKPLAYER(playerid))
{
new BAN_DAT[ban_data];
BAN_GETDATA(playerid, BAN_DAT);
if (BAN_DAT[ban_rd] == -2 && BAN_DAT[ban_rh] == -2)
{
new bTxt[128];
format(bTxt, sizeof bTxt, "You Are Permenantly Banned From RTCnR For '%s'.", BAN_DAT[ban_reason]);
SendClientMessage(playerid, 0xCC0000FF, bTxt);
// This Just Returns me: You Are Permenantly Banned From RTCnR For ''.
SendClientMessage(playerid, 0xCC0000FF, "If You Consider This Ban as a False Positive or a Mistake, You May Contact rtcnr@reaccess.co.uk");
SetTimerEx("AltKick", 1000, false, "i", playerid);
return 1;
}
}
(...)
}