CMD:ban(playerid, params[])
{
new string[128], id, msg[250], reason[30], ip[16], year, month, day, sec, hrs, mins, File:BanLog;
if(pData[playerid][Login] == 0) return SendClientMessage(playerid, COLOR_RED, "*** Please login first! ***");
if(pData[playerid][Admin] < 2) return SendClientMessage(playerid, COLOR_RED, "*** You are not Administrator ***");
if(sscanf(params, "us[30]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [playerid] [reason]");
GetPlayerIp(id, ip, sizeof(ip));
getdate(year, month, day);
gettime(hrs, mins, sec);
if(!strlen(reason)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Put a Reason don't leave the Reason Blank!");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "*** Player not connected ***");
format(string, sizeof(string), "%s(%d) has been banned by Administrator %s(%d) for %s", GetpName(id), id, GetpName(playerid), playerid, reason);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
pData[id][Banned] = 1;
dini_Set(DataPath(id), "Reason", reason);
dini_Set(DataPath(id), "BanBy", GetpName(playerid));
format(string, sizeof(string),"banip %s", ip[id]);
SendRconCommand(string);
SendRconCommand("reloadbans");
BanLog = fopen("Clan/Log/BanLog.txt", io_append);
format(msg, sizeof(msg), "[%02d/%02d/%02d | %02d/%02d/%02d] %s(%d) has been banned by Administrator %s(%d) for %s [IP: %s]", month, day, year, hrs, mins, sec, GetpName(id), id, GetpName(playerid), playerid, reason, ip);
fwrite(BanLog, msg);
fclose(BanLog);
format(string, sizeof(string), "*** You banned %s(%d) for %s ***", GetpName(id), id, reason);
SendClientMessage(playerid, COLOR_RED, string);
SendClientMessage(playerid, COLOR_RED, "Note: "white"Your banning to the player will be save in BanLog in DataBase!");
for(new i = 0; i < 100; i++)
SendClientMessage(id, -1," ");
format(string, sizeof(string), "*** You are banned by Administrator %s(%d) for %s ***", GetpName(playerid), playerid, reason);
SendClientMessage(id, COLOR_RED, string);
SendClientMessage(id, -1, " ");
SendClientMessage(id, -1, "Goto "red"www.impactplayers.smf2hosting.com - Impact Player - Ban Appeal");
SendClientMessage(id, -1, "And create your ban appeal, Don't try to ban evade or else");
SendClientMessage(id, -1, "Your chance being unban will decrease to 50 percent!");
SendClientMessage(id, -1, " ");
SendClientMessage(id, COLOR_RED, "*** You are banned from [iP] clan SERVER ***");
Kick(id);
return 1;
}
if(dini_Int(DataPath(playerid), "Ban") == 1)
{
new string[128], banby[24], reason[92];
for(new i = 0; i < 100; i++)
SendClientMessage(playerid, -1, " ");
SendClientMessage(playerid, COLOR_RED, "*** You are banned from [iP] clan SERVER ***");
SendClientMessage(playerid, -1, " ");
format(reason, 92, "%s", dini_Get(DataPath(playerid), "Reason"));
format(banby, 24, "%s", dini_Get(DataPath(playerid), "BanBy"));
format(string, sizeof(string), "You are banned by "white"%s | "red"Reason: "white"%s", banby, reason);
SendClientMessage(playerid, COLOR_RED, string);
Kick(playerid);
}
Connecting to [iP] offical clan server
[19:52:15] Incoming connection: 192.168.1.100:2056 [19:52:15] [join] Romel has joined the server (0:192.168.1.100) [19:52:20] [part] Romel has left the server (0:2) - Remember 0:2 means Kick/Ban
IP=192.168.1.100 (this is banned ip in /ban)
if(dini_Int(DataPath(playerid), "Ban") == 1)
{
new string[128], banby[24], reason[92];
for(new i = 0; i < 64; i++)
{
SendClientMessage(playerid, -1, " ");
SendClientMessage(playerid, COLOR_RED, "*** You are banned from [iP] clan SERVER ***");
SendClientMessage(playerid, -1, " ");
}
format(reason, 92, "%s", dini_Get(DataPath(playerid), "Reason"));
format(banby, 24, "%s", dini_Get(DataPath(playerid), "BanBy"));
format(string, sizeof(string), "You are banned by "white"%s | "red"Reason: "white"%s", banby, reason);
SendClientMessage(playerid, COLOR_RED, string);
Kick(playerid);
}
Connecting to...
|
Didn't work i move the code to OnPlayerConnect again now i'm stuck again in
Код:
Connecting to... |