SA-MP Forums Archive
[Ajuda] comando ( desbanir so o ip do player ) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] comando ( desbanir so o ip do player ) (/showthread.php?tid=488330)



comando ( desbanir so o ip do player ) - Stifler4i20 - 17.01.2014

Eu queria criar um comando para desbanir so o ip do player mais eu nao consigo fazer isso quem poderia me ajudar??


Re: comando - iMix - 17.01.2014

http://forum.sa-mp.com/showthread.ph...=desbanir+zcmd

Ae Ve se e isso que voce quer. muito bom esse sistema.


Re: comando - PT - 17.01.2014

tem aqui um bom sistema de ban, da uma olhada

https://sampforum.blast.hk/showthread.php?tid=294087


Re: comando ( desbanir so o ip do player ) - Gii - 17.01.2014

Strcmp

pawn Код:
#define IPS_BANIDOS "IPsBanidos/%s.ini"  //altere conforme seu GM

public OnPlayerCommandText(playerid, cmdtext[]) {

    new cmd[128], idx;
    new tmp[128];
    cmd = strtok(cmdtext, idx);
   
    if ( !strcmp(cmd, "/desbanirip")) {

        if (!IsPlayerAdmin(playerid))
            return false;

        tmp = strtok(cmdtext, idx);

        if (!strlen(tmp))
            return SendClientMessage(playerid, -1, "Uso correto: /desbanirip [IP]");

        format (cmdtext, sizeof cmdtext, IPS_BANIDOS, tmp);

        if (!fexist(cmdtext))
            return SendClientMessage(playerid, -1, "Este IP nгo esta banido!");

        fremove(cmdtext);

        format (cmdtext, sizeof cmdtext, "O IP %s foi desbanido!", tmp);
        SendClientMessage(playerid, -1, cmdtext);

        return 1;
    }
    return 0;
}
ZCMD

pawn Код:
#define IPS_BANIDOS "IPsBanidos/%s.ini" //altere conforme seu GM

CMD:desbanirip(playerid, params[]) {

    if (!IsPlayerAdmin(playerid))
        return false;
       
    if (isnull(params))
        return SendClientMessage(playerid, -1, "Uso correto: /desbanirip [IP]");
       
    new str[128];
    format (str, 128, IPS_BANIDOS, params);

    if (!fexist(str))
        return SendClientMessage(playerid, -1, "Este IP nгo esta banido!");

    fremove(str);

    format (str, 128, "O IP %s foi desbanido!", params);
    SendClientMessage(playerid, -1, str);
    return 1;
}



Re: comando ( desbanir so o ip do player ) - zDark - 17.01.2014

pawn Код:
if( !strcmp( cmd, "/desbanirip", true ))
    {
        //Admin
        {
            new tmp[256], gStr[150], gstring[100];
            tmp = strtok( cmdtext, idx );
            if( !strlen( tmp ))
            {
                SendClientMessage( playerid, COR, "[ x ] Uso correto: /DesbanirIP [ IP ]" );
                return 1;
            }
            format( gStr, sizeof( gStr ), "unbanip %s", tmp );
            SendRconCommand( gStr );
            SendRconCommand( "reloadbans" );
            foreach(Player, i )
            {
                //Admin
                {
                    format( gstring, sizeof( gstring ), "[ DESBAN-IP ] IP: %s foi desbanido pelo( A ) administrador( a ) %s", tmp, PlayerName( playerid ));
                    SendClientMessage( i, COR, gstring );
                }
            }
        }
        return 1;
    }
  }



Re: comando ( desbanir so o ip do player ) - StreetGT - 17.01.2014

se vocк tiver a rcon tambйm pode fazer assim:

/rcon login "rcon_password"

depois

/rcon unbanip "ip_adress"