[Ajuda] Sistema de ban
#1

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(string128,"-[BAN] %s foi banido pelo %s %s Motivo: %s",Player[id][pName], AccountName(playerid), Player[playerid][pName],reason);
    else
        
format(string128,"[BAN] %s foi banido pelo %s %s Tempo: %d dias Motivo: %s",Player[id][pName], AccountName(playerid), Player[playerid][pName], daysreason);
    
WriteLog("bans",string);
    
SendClientMessageToAll(ADMIN_RED,string);
    new 
playerip[24];
    
GetPlayerIp(idplayeripsizeof(playerip));
    new 
banfile[256];
    
banfile GetBannedFile(id);
    new 
hourminuteseconddaymonthyear;
    
gettime(hourminutesecond);
    
getdate(yearmonthday);
    
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(stringsizeof(string), "%02d/%02d �s %02d:%02d"daymonthhourminute);
    
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(string128,"[BAN] Nick: %s - Admin: %s - Motivo: %s"Player[id][pName], Player[playerid][pName], reason);
    
SendClientMessage(playeridCOLOR_ORANGE,string);
    
format(string128,"[BAN]  Data: %02d/%02d/%d - IP: %s  (Salve Esses Dados)",daymonthyearplayerip);
    
SendClientMessage(playeridCOLOR_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"0strlen("governo"), 255);
            
strmid(BizzInfo[empresa][bExtortion], "Nenhuma"0strlen("Nenhuma"), 255);
        }
        else
        {
            
SBizzInfo[empresa][sbLocked] = 1;
            
SBizzInfo[empresa][sbOwned] = 0;
            
strmid(SBizzInfo[empresa][sbOwner], "governo"0strlen("governo"), 255);
            
strmid(SBizzInfo[empresa][sbExtortion], "---"0strlen("---"), 255);
        }
        
empresa 255;
    }
    
CallRemoteFunction("OnPlayerBan","i",id);
    return 
Kick(id);

Reply


Messages In This Thread
Sistema de ban - by lKiller - 31.01.2016, 02:46

Forum Jump:


Users browsing this thread: 1 Guest(s)