Toda vez que o player й banido e loga no servidor o tempo de ban diminui em 7 ou 4 dias quando ele conecta, toda vez diminui mais
PHP код:
forward BanExtend(playerid,id,reason[], days); // Sistema de ban - Killer
public BanExtend(playerid,id,reason[], days)
{
new string[128];
if(!days)
format(string, 128,"-[BAN] %s foi banido pelo %s %s Motivo: %s",Player[id][pName], AccountName(playerid), Player[playerid][pName],reason);
else
format(string, 128,"[BAN] %s foi banido pelo %s %s Tempo: %d dias Motivo: %s",Player[id][pName], AccountName(playerid), Player[playerid][pName], days, reason);
WriteLog("bans",string);
SendClientMessageToAll(ADMIN_RED,string);
new playerip[24];
GetPlayerIp(id, playerip, sizeof(playerip));
new banfile[256];
banfile = GetBannedFile(id);
new hour, minute, second, day, month, year;
gettime(hour, minute, second);
getdate(year, month, day);
DOF2_CreateFile(banfile);
DOF2_SetString(banfile,"PlayerName", Player[id][pName]);
if(days)
{
DOF2_SetInt(banfile,"BanTime", GetTickCount()+ONE_DAY*days);
DOF2_SetInt(banfile,"BanDays", days);
}
new str[52];
format(str,52,"%s %s", AccountName(playerid), Player[playerid][pName]);
DOF2_SetString(banfile,"AdminName", str);
DOF2_SetString(banfile,"Motivo", reason);
format(string, sizeof(string), "%02d/%02d �s %02d:%02d", day, month, hour, minute);
DOF2_SetString(banfile,"Data", string);
if(gPlayerLogged[playerid])
{
new banfile2[256];
format(banfile2,256,"bans/%s.ini", Player[id][pName]);
DOF2_CreateFile(banfile2);
if(days)
{
DOF2_SetInt(banfile2,"BanTime", GetTickCount()+ONE_DAY*days);
DOF2_SetInt(banfile2,"BanDays", days);
}
DOF2_SetString(banfile2,"AdminName", str);
DOF2_SetString(banfile2,"Motivo", reason);
DOF2_SetString(banfile2,"Data", string);
DOF2_SetString(banfile2,"IP", playerip);
if(days)
DOF2_SetInt(GetPlayerFile(id),"Banned",2);
else
DOF2_SetInt(GetPlayerFile(id),"Banned",1);
}
SendClientMessage(playerid,COLOR_GREEN,"Informa��es importantes sobre o Ban:");
format(string, 128,"[BAN] Nick: %s - Admin: %s - Motivo: %s", Player[id][pName], Player[playerid][pName], reason);
SendClientMessage(playerid, COLOR_ORANGE,string);
format(string, 128,"[BAN] Data: %02d/%02d/%d - IP: %s (Salve Esses Dados)",day, month, year, playerip);
SendClientMessage(playerid, COLOR_ORANGE,string);
if(Player[id][pPbiskey] != 255)
{
new empresa = Player[id][pPbiskey];
if(empresa < 100)
{
BizzInfo[empresa][bLocked] = 1;
BizzInfo[empresa][bOwned] = 0;
strmid(BizzInfo[empresa][bOwner], "governo", 0, strlen("governo"), 255);
strmid(BizzInfo[empresa][bExtortion], "Nenhuma", 0, strlen("Nenhuma"), 255);
}
else
{
SBizzInfo[empresa][sbLocked] = 1;
SBizzInfo[empresa][sbOwned] = 0;
strmid(SBizzInfo[empresa][sbOwner], "governo", 0, strlen("governo"), 255);
strmid(SBizzInfo[empresa][sbExtortion], "---", 0, strlen("---"), 255);
}
empresa = 255;
}
CallRemoteFunction("OnPlayerBan","i",id);
return Kick(id);
}