[Ajuda] ajuda
#6

Olha cara seu sistema estava muito bugado, tive que praticamente refaze-lo entгo pode ter escapado algo da minha visгo mais creio que nгo, teste e veja se ira funcionar

pawn Код:
#define LOCALBANNICK "/Nicks banidos/%s.cfg"
#define LOCALBANIP   "/IPs banidos/%s.cfg"

stock BanId(playerid, mMotivo[])
{
    new mStr[128], mName[24];
    GetPlayerName(playerid, mName, 24);
    format(mStr, 128, "-Aviso- O jogador %s foi banido [Motivo: %s]", mName, mMotivo);
    SendClientMessageToAll(-1, mStr);
    return Kick(playerid);
}
stock BanNick(playerid, mMotivo[])
{
    new mStr[128], mName[24];
    GetPlayerName(playerid, mName, 24);
    format(mStr, 128, LOCALBANNICK, mName);
    DOF2_CreateFile(mStr);
    DOF2_SetString(mStr, "Motivo", mMotivo);
    format(mStr, 128, "-Aviso- O jogador %s foi banido [Motivo: %s]", mName, mMotivo);
    SendClientMessageToAll(-1, mStr);
    return Kick(playerid);
}
stock BanIP(playerid, mMotivo[])
{
    new mStr[128], mIP[16];
    GetPlayerIp(playerid, mIP, 16);
    format(mStr, 128, LOCALBANIP, mIP);
    DOF2_CreateFile(mStr);
    DOF2_SetString(mStr, "Motivo", mMotivo);
    format(mStr, 128, "-Aviso- O IP %i foi banido [Motivo: %s]", mIP, mMotivo);
    SendClientMessageToAll(-1, mStr);
    return Kick(playerid);
}
stock BanNickOff(Nick[], mMotivo[])
{
    new mStr[128];
    format(mStr, 128, LOCALBANNICK, Nick);
    DOF2_CreateFile(mStr);
    DOF2_SetString(mStr, "Motivo", mMotivo);
    format(mStr, 128, "-Aviso- O Nick %s foi banido-off [Motivo: %s]", Nick, mMotivo);
    return SendClientMessageToAll(-1, mStr);
}
stock BanIPOFF(mIP[], mMotivo[])
{
    new mStr[128];
    format(mStr, 128, LOCALBANIP, mIP);
    DOF2_CreateFile(mStr);
    DOF2_SetString(mStr, "Motivo", mMotivo);
    format(mStr, 128, "-Aviso- O IP %i foi banido-off [Motivo: %s]", mIP, mMotivo);
    return SendClientMessageToAll(-1, mStr);
}
stock UnBanNick(Nome[])
{
    new mStr[128];
    format(mStr, 128, LOCALBANNICK, Nome);
    if(!DOF2_FileExists(mStr))return SendClientMessage(playerid, -1,"[ERRO] Conta nao banida.");
    DOF2_RemoveFile(mStr);
    format(mStr, 128, "Aviso- O nick %s acaba de ser desbanido.",Nome);
    return SendClientMessageToAll(-1, mStr);
}
stock UnBanIP(mIP[])
{
    new mStr[128];
    format(mStr, 128, LOCALBANIP, mIP);
    if(!DOF2_FileExists(mStr))return SendClientMessage(playerid, -1,"[ERRO] Conta nao banida.");
    DOF2_RemoveFile(mStr);
    format(mStr, 128, "-Aviso- O ip %i acaba de ser desbanido.", mIP);
    SendClientMessageToAll(-1, mStr);
}
stock CheckBan(playerid)
{
    new mStr[128], mName[24], mIP[16];
    GetPlayerIp(playerid, mIP, 16);
    format(mStr, 128, LOCALBANIP, mIP);
    if(DOF2_FileExists(mStr))
    {
        SendClientMessage(playerid,-1,"-Aviso- Voce esta banido");
        return Kick(playerid);
    }
    GetPlayerName(playerid, mName, 24);
    format(mStr, 128, LOCALBANNICK, mName);
    if(DOF2_FileExists(mStr))
    {
        SendClientMessage(playerid,-1,"-Aviso- Voce esta banido");
        return Kick(playerid);
    }
    return 1;
}

CMD:ban(mPlayer, mParams[])
{
    new mPlayerID, mMotivo[128];
    if(sscanf(mParams, "us[128]", mPlayerID, mMotivo))//erro
    {
        return SendClientMessage(mPlayer, -1, "/ban (id/name) (motivo)");
    }
    return BanId(mPlayerID, mMotivo);
}

CMD:desban(mPlayer, mParams[])
{
    if(isnull(mParams))
    {
        return SendClientMessage(mPlayer, -1, "/desban (ip/nick)");
    }

    new mNum, i;
    for(; i != strlen(mParams); ++i)
    {
        if(mParams[i] == '.' || (mParams[i] >= '0' && mParams[i] <= '9'))
        {
            ++mNum;
        }
    }
    if(mNum >= 5)
    {
        UnBanIP(mParams);
    }
    else
    {
        UnBanNick(mParams);
    }
    return 1;
}
Reply


Messages In This Thread
ajuda - by lucaskill66 - 09.10.2012, 23:40
Re: ajuda - by ViniBorn - 09.10.2012, 23:53
Re: ajuda - by arakuta - 10.10.2012, 00:05
Re: ajuda - by Metropole RP - 10.10.2012, 00:40
Re: ajuda - by lucaskill66 - 10.10.2012, 01:12
Re: ajuda - by Metropole RP - 10.10.2012, 01:41
Re: ajuda - by zSuYaNw - 10.10.2012, 01:56
Re: ajuda - by Jason` - 10.10.2012, 02:02
Re: ajuda - by lucaskill66 - 10.10.2012, 02:50
Re: ajuda - by Metropole RP - 10.10.2012, 19:17

Forum Jump:


Users browsing this thread: 1 Guest(s)