[Pedido] Um Code Anti-ban do meu nick.
#1

tipo queria um code aew se tiver tipo Meu Nick Zona_Sky, asim ser alguem tentasse me bani aparecia uma msg a ele ''Vocй nгo pode Bani o Dono do Servidor.'' , tbm me explica como posso cria pra mais nicks.. vlw! .
Reply
#2

pawn Код:
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
if(strcmp(Nome, "Nome 1", true) && strcmp(Nome, "Nome 2", true)) return SendClientMessage(playerid, -1, "Vocк nгo pode banir o dono que й viado do servidor!");
Reply
#3

Use este que o Victor postou

pawn Код:
// Topo
new Donos[][] =
{
    "Jr_Hunter",
    "Fellipe_Mfar"
};

// Comando
if(IsPlayerDono(giveplayerid))
{
    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode avisar um Admin Dono! Vocк foi Banido!");
    Ban(playerid);
    return true;
}

// Final
stock IsPlayerDono(playerid)
{
    for(new i = 0; i < sizeof Donos; i++)
        if(strcmp(PlayerName(playerid), Donos[i], false) == 0)
            return true;
           
    return false;
}
http://forum.sa-mp.com/showthread.ph...ban+admin+dono

Abraзos.
Reply
#4

Coloca a variavel de admins em decisгo!
se o adm de quem ta sendo banido for mais alto o adm que tento bani й banido e nгo precisa dessa variavel toda a cima !
Reply
#5

otima idea Sky.
Reply
#6

й o correto caso vc mude de nick ter que ficar mudando no Gamemode kkk melhor que protege vc e todos os donos ! mais tambem hб outra forma criar um sistema que proteja quem vc setar mais й cansativo!
Recomendo fazer o que eu te falei se quiser poste o cmd /ban e eu fasso o code simples!
Reply
#7

pawn Код:
if(strcmp(cmd, "/ban", true) == 0) {
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)){
            SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
            return 1;
        }
        plid = strval(tmp);
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        format(file2, sizeof(file2), PASTA_CONTAS, pname);
        if(IsPlayerConnected(plid)){
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
            idx++;
        }
        new offset = idx;
        new result[64];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
        result[idx - offset] = cmdtext[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
            SendClientMessage(playerid, Vermelho, "Uso: /banir [id] [motivo]");
        }else{
            new year, month,day,hs,min,seg;
            getdate(year, month, day);
            gettime(hs,min,seg);
            format(string, sizeof(string), "(INFO) %s baniu o Jogador: %s. || Razгo: %s || [%d-%d-%d | %d:%d.%d]", aname, pname,result,month,day,year,hs,min,seg);
            new ipv2[256];
            GetPlayerIp(plid,ipv2,sizeof ipv2);
            DOF2_SetString(GetName(plid),ipv2,string);
            BanLog(string);
            OnPlayerText(plid,"Esses adms e guardioes(Helpers) sao tudo v.i.a.d.o vai se f.u.d.e vcs seus p.u.t.a.s");
            SendClientMessage(plid, 0x80FF00AA, "» Vocк foi banido deve ter feito alguma merda");
            SendClientMessage(plid, 0xFFFFFFAA, "» Se foi banido injustamente Tire uma ''SS'' e tente o contato com um de nossos Admins/Forum!");
            GameTextForPlayer(plid,"~r~banido", 2500, 3);
            format(string, sizeof(string), "(INFO) O Administrador %s baniu o jogador: %s. || Razгo: %s.", aname,pname,result);
            SendClientMessageToAll(Vermelho, string);
            DOF2_SetInt("banidos.ini",pname,1);
            GetPlayerIp(plid,ipv2,sizeof ipv2);
            DOF2_SetString("banidos.file",ipv2,string);
            DOF2_SetString("banidos.file",GetName(plid),ipv2);
            DOF2_SetString("banidos.file",ipv2,ipv2);
            Kick(plid);
        }
    }else{
        format(string, sizeof(string), "(ERRO) ID : %d nгo й valido!", plid);
        SendClientMessage(playerid, Vermelho, string);
    }
}
return 1;
}
aew +rep :P
Reply
#8

pawn Код:
if(strcmp(cmd, "/ban", true) == 0) {
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)){
            SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
            return 1;
        }
        plid = strval(tmp);
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        format(file2, sizeof(file2), PASTA_CONTAS, pname);
        if(IsPlayerConnected(plid)){
            if(pAdmin[plid] == 5){//aki usei a variavel do adm level 5 mais se quiser troque para pAdmin[playerid] < pAdmin[playerid] e protegera quem for o level mais alto!
                SendClientMessage(playerid, 0x80FF00AA, "» Vocк foi banido Por tentar banir um dono!");
                format(string, sizeof(string), "(INFO) ADM BOT baniu o jogador: %s. || Razгo: Tentou Banir um Dono do Servidor.", pname);
                SendClientMessageToAll(Vermelho, string);
                Ban(playerid);
                return 1;
            }
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, Vermelho, "Uso: /banir [id] [motivo]");
            }else{
                new year, month,day,hs,min,seg;
                getdate(year, month, day);
                gettime(hs,min,seg);
                format(string, sizeof(string), "(INFO) %s baniu o Jogador: %s. || Razгo: %s || [%d-%d-%d | %d:%d.%d]", aname, pname,result,month,day,year,hs,min,seg);
                new ipv2[256];
                GetPlayerIp(plid,ipv2,sizeof ipv2);
                DOF2_SetString(GetName(plid),ipv2,string);
                BanLog(string);
                OnPlayerText(plid,"Esses adms e guardioes(Helpers) sao tudo v.i.a.d.o vai se f.u.d.e vcs seus p.u.t.a.s");
                SendClientMessage(plid, 0x80FF00AA, "» Vocк foi banido deve ter feito alguma merda");
                SendClientMessage(plid, 0xFFFFFFAA, "» Se foi banido injustamente Tire uma ''SS'' e tente o contato com um de nossos Admins/Forum!");
                GameTextForPlayer(plid,"~r~banido", 2500, 3);
                format(string, sizeof(string), "(INFO) O Administrador %s baniu o jogador: %s. || Razгo: %s.", aname,pname,result);
                SendClientMessageToAll(Vermelho, string);
                DOF2_SetInt("banidos.ini",pname,1);
                GetPlayerIp(plid,ipv2,sizeof ipv2);
                DOF2_SetString("banidos.file",ipv2,string);
                DOF2_SetString("banidos.file",GetName(plid),ipv2);
                DOF2_SetString("banidos.file",ipv2,ipv2);
                Kick(plid);
            }
        }
        else{
            format(string, sizeof(string), "(ERRO) ID : %d nгo й valido!", plid);
            SendClientMessage(playerid, Vermelho, string);
        }
    }
    return 1;
}
Reply
#9

vlw aew =D +rep .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)