[Pedido] Ban por nick.
#1

Boa noite.
Estou a procura de um banimento por nick, mesmo se o player estiver offline...

O local das contas que ficam armazenadas os dados dos players em .ini;

pawn Code:
#define DIRETORIO  "/usuarios/%s.ini"
Dai verificar se a conta do player existe ou nгo, caso exista ela serб banida e adicionada а;
pawn Code:
dini_IntSet("Banidos.ini", banido, 1);
Poderiam me dar uma mгo?
Reply
#2

Olha й esse aki que eu tenho aki no meu server.
Tenta da uma modificada ai e coloca pra ver.

pawn Code:
if(strcmp(cmd, "/banirnick", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 5){
new tmp[256];
tmp = strtok(cmdtext, idx);
format(file2, sizeof(file2), PASTA_CONTAS, tmp);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /banirnick [nick]");
return 1;
}
dini_IntSet("nickban.ini",tmp,1);
SendClientMessage(playerid, Verde, "(INFO) Nick banido!");
format(string, sizeof(string), "(INFO) O administrador %s baniu o nick %s", aname,tmp);
SendClientMessageToAll(tcadm, string);
return 1;
}
}
Reply
#3

Quote:
Originally Posted by [BVO]Alexandre[Tw]
View Post
Olha й esse aki que eu tenho aki no meu server.
Tenta da uma modificada ai e coloca pra ver.

pawn Code:
if(strcmp(cmd, "/banirnick", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 5){
new tmp[256];
tmp = strtok(cmdtext, idx);
format(file2, sizeof(file2), PASTA_CONTAS, tmp);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /banirnick [nick]");
return 1;
}
dini_IntSet("nickban.ini",tmp,1);
SendClientMessage(playerid, Verde, "(INFO) Nick banido!");
format(string, sizeof(string), "(INFO) O administrador %s baniu o nick %s", aname,tmp);
SendClientMessageToAll(tcadm, string);
return 1;
}
}
Cуdigo mal indentado, feito de qualquer jeito... Seu servidor por acaso й baixado da NET?
Reply
#4

Tenso '-' Indentaзгo level 500 -q
Reply
#5

Quote:
Originally Posted by Ley
View Post
Tenso '-' Indentaзгo level 500 -q
alйm de pedir vocк vai reclamar TENSO й vocк e se vocк ta reclamando vai arruma a parte dele ele ja fez agora se vira
Reply
#6

pawn Code:
if(strcmp(cmd, "/banirnick", true) == 0)
    {
        new plname[MAX_PLAYER_NAME];
        new arq[128];
        GetPlayerName(playerid, plname, MAX_PLAYER_NAME);
        format(arq, sizeof(arq), DIRETORIO, plname);
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid , -1, " Vocк nгo й um adminstrador!");
        tmp = strtok(cmdtext, idx);
        format(arq, sizeof(arq), DIRETORIO, tmp);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Digite: /banirnick [nick]");
        dini_IntSet("NicksBanidos.ini", tmp , 1);
        format(string, sizeof(string), "( Info ) Usъario %s Banido.", tmp);
        SendClientMessage(playerid, -1, string);
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)