Ban por nick. -
Ley - 31.07.2012
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?
Re: Ban por nick. -
[BVO]Alexandre[Tw] - 01.08.2012
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;
}
}
Re: Ban por nick. -
Mercurio - 01.08.2012
Quote:
Originally Posted by [BVO]Alexandre[Tw]
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?
Re: Ban por nick. -
Ley - 01.08.2012
Tenso '-' Indentaзгo level 500 -q
Re: Ban por nick. -
GhosT_[] - 01.08.2012
Quote:
Originally Posted by Ley
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
Re: Ban por nick. -
dPlaYer_ - 01.08.2012
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;
}