25.05.2014, 10:42
Hello
i have problem in my GM when i join in Server is say me "Your IP is banned on this server" Post a unban request , and other players is have example this Problem
code
i have problem in my GM when i join in Server is say me "Your IP is banned on this server" Post a unban request , and other players is have example this Problem
code
pawn Код:
MySQLCheckConnection();
ClearCrime(playerid);
ClearFishes(playerid);
ClearCooking(playerid);
ClearGroceries(playerid);
ClearMarriage(playerid);
GetPlayerName(playerid, plname, sizeof(plname));
SetPlayerColor(playerid, COLOR_GRAD2);
new playersip[256];
GetPlayerIp(playerid,playersip,sizeof(playersip));
new quer[256];
format(quer, sizeof(quer), "SELECT * FROM banuri WHERE TIP=2 AND PlayerIP='%s'", playersip);
mysql_query(quer);
mysql_store_result();
if(mysql_num_rows()!=0)
{
SendClientMessage(playerid, COLOR_GREY, "Your IP is banned on this server");
SendClientMessage(playerid, COLOR_GREY, "Post a unban request on forum");
SetTimerEx("Kicka", 2000, 0, "d", playerid);
return 1;
}
new sqlaccountstatus = MySQLCheckAccount(plname);
if(sqlaccountstatus != 0)
{
/*if(MySQLCheckIPBanned(playerid, sqlaccountstatus, pip) != 0)
{
new string[128];
format(string, sizeof(string), "Contul tau este banat permanent de catre adminul %s, reason: %s.",PlayerData[playerid][pAdminBan],PlayerData[playerid][pBanReason]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "IP-ul tau este: %s", pip);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
SendClientMessage(playerid, COLOR_WHITE, "To unban visit {B20000}forum");
Kick(playerid);
return 0;
}*/
if(MySQLCheckAccountLocked(sqlaccountstatus, playerid) != 0)
{
if(PlayerData[playerid][pBanaP] == 0)
{
new string[128];
format(string, sizeof(string), "Your account was permanently banned by admin %s, reason: %s.",PlayerData[playerid][pAdminBan],PlayerData[playerid][pBanReason]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
SendClientMessage(playerid, COLOR_WHITE, "To unban visit forum");
SetTimerEx("Kicka", 2000, 0, "d", playerid);
return 0;
}
else if(PlayerData[playerid][pBanaP] != 0)
{
new zero1[5];
new zero2[5];
new zero3[5];
new zero4[5];
new year, month,day;
getdate(year, month, day);
if(PlayerData[playerid][pBanaP] <= year)
{
if(PlayerData[playerid][pBanaP] < year)
{
new query[128];
PlayerData[playerid][pLocked] = 0;
format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
mysql_query(query);
}
else if(PlayerData[playerid][pBanaP] == year)
{
if(PlayerData[playerid][pBanlP] < month)
{
new query[128];
PlayerData[playerid][pLocked] = 0;
format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
mysql_query(query);
}
else if(PlayerData[playerid][pBanlP] == month)
{
if(PlayerData[playerid][pBanzP] < day)
{
new query[128];
PlayerData[playerid][pLocked] = 0;
format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
mysql_query(query);
}
else if(PlayerData[playerid][pBanzP] == day)
{
new hour,minute,second;
gettime(hour,minute,second);
if(PlayerData[playerid][pBanoP] < hour)
{
new query[128];
PlayerData[playerid][pLocked] = 0;
format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
mysql_query(query);
}
else if(PlayerData[playerid][pBanoP] == hour)
{
if(PlayerData[playerid][pBanmP] < minute)
{
new query[128];
PlayerData[playerid][pLocked] = 0;
format(query, sizeof(query), "DELETE FROM banuri WHERE LOWER(Nume) = LOWER('%s')", plname);
mysql_query(query);
format(query, sizeof(query), "UPDATE players SET Locked='%d' WHERE LOWER(Name) = LOWER('%s')", PlayerData[playerid][pLocked], plname);
mysql_query(query);
}
else
{
new string[128];
if(PlayerData[playerid][pBanoP] < 10)
{
zero1 = "0";
}
if(PlayerData[playerid][pBanmP] < 10)
{
zero2 = "0";
}
if(PlayerData[playerid][pBanzP] < 10)
{
zero3 = "0";
}
if(PlayerData[playerid][pBanlP] < 10)
{
zero4 = "0";
}
format(string, sizeof(string), "Your account is Banned by Admin: %s, pana %s%d/%s%d/%d ora %s%d:%s%d, reason: %s.",PlayerData[playerid][pAdminBan],zero3,PlayerData[playerid][pBanzP],zero4,PlayerData[playerid][pBanlP],PlayerData[playerid][pBanaP],zero1,PlayerData[playerid][pBanoP],zero2,PlayerData[playerid][pBanmP],PlayerData[playerid][pBanReason]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
SendClientMessage(playerid, COLOR_WHITE, "To unban visit forum");
SetTimerEx("Kicka", 2000, 0, "d", playerid);
return 0;