-- RESOLVIDO POR DRAKON E PODEROSO CHEFГO -- -
Kasura - 15.11.2010
-- RESOLVIDO POR DRAKON E PODEROSO CHEFГO --
Re: [AJUDA] Log Ban! -
[]Fabricio[] - 15.11.2010
como que й o log de ban do click21?
Re: [AJUDA] Log Ban! -
Kasura - 15.11.2010
ele salva em linhas separadas e escreve quando o player loga
Nick Banido:
Quem Baniu:
Motivo:
Data:
Hora:
Re: [AJUDA] Log Ban! -
SuB_ZeRo0_ - 15.11.2010
Tipo... no ban:
pawn Код:
if(!fexist("banlog.sub")) {new File:C=fopen("banlog.sub",io_write);fclose(C);}
new File:L=fopen("banlog.sub",io_append);
new textobanlog[200],d,f,g,h,j,k;
getdate(g,f,d);gettime(h,j,k);
format(textobanlog,200,"Conta: %s | Ban: [Permanente/Temporбrio] | Admin: %s | Motivo: %s | Data: %i/%i/%i | Hora: %i:%i\r\n",PlayerName(id),PlayerName(playerid),d,f,g,h,j);
fwrite(textobanlog);
fclose(L);
Adicionarб uma linha e pularб uma no final.
Para nгo ficar uma em cima da outra.
Fiz na pressa, qualquer erro, arrume. (:
@EDIT: Para dar load й outra coisa.. e eu acho mais facil criar um arquivo para cada ban. (NГO USE O JEITO A CIMA, MODIFIQUE-O.)
Poderб usar dini para facilitar. Exemplo:
Dentro de: Bans/Sub_Zero.ini
Nome: Sub_Zero
Admin: Noob_Zero
Motivo: Xiterzinho
Data: 33/13/1500
Hora: 44:21
Ban: Permanente
Re: [AJUDA] Log Ban! -
Ricop522 - 15.11.2010
Cria na conta do player, tipo.
Nгo salva o tanto que ele matou, morreu...
Vocк cria pra salvar quem baniu ele, horбrio e talz..
Re: [AJUDA] Log Ban! -
Kasura - 15.11.2010
й to fazendo isso agora ^^
@problema
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[128], string1[128], string2[128], string3[128], string4[128];
format(file,sizeof(file),"/sbadmin/Ban/%s.ini",name);
if(fexist(file))
{
new Banido1, Banidor1, Motivo1, Dia1, Mes1, Ano1;
Banido1 = dini_Int(file,"Banido");
Banidor1 = dini_Int(file,"Banidor");
Motivo1 = dini_Int(file,"Motivo");
Dia1 = dini_Int(file,"Dia");
Mes1 = dini_Int(file,"Mкs");
Ano1 = dini_Int(file,"Ano");
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
SendClientMessage(playerid,0xDEEE20FF,string1);
SendClientMessage(playerid,0xDEEE20FF,string2);
SendClientMessage(playerid,0xDEEE20FF,string3);
SendClientMessage(playerid,0xDEEE20FF,string4);
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
format(string1, sizeof(string1), "Nick: %s Foi Banido do Servidor)",Banido1);
format(string2, sizeof(string2), "Por: %s)",Banidor1);
format(string3, sizeof(string2), "Motivo: %s)",Motivo1);
format(string4, sizeof(string2), "Data: %d/%d/%d)",Dia1, Mes1, Ano1);
Kick(playerid);
}
Bom fiz o sistema funfo e talz salvo as informaзхes....
mas o problema esta na hora de ler
simplesmente n aparece mensagem nenhuma entre as linhas de cima e baixo
apenas 1 vacuo sem nada escrito
pq?
Re: [AJUDA] Log Ban! -
Canabis - 15.11.2010
tenta assim kasura...
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[128], string1[128], string2[128], string3[128], string4[128];
format(file,sizeof(file),"/sbadmin/Ban/%s.ini",name);
if(fexist(file))
{
new Banido1, Banidor1, Motivo1, Dia1, Mes1, Ano1;
Banido1 = dini_Int(file,"Banido");
Banidor1 = dini_Int(file,"Banidor");
Motivo1 = dini_Int(file,"Motivo");
Dia1 = dini_Int(file,"Dia");
Mes1 = dini_Int(file,"Mкs");
Ano1 = dini_Int(file,"Ano");
format(string1, sizeof(string1), "Nick: %s Foi Banido do Servidor)",Banido1);
format(string2, sizeof(string2), "Por: %s)",Banidor1);
format(string3, sizeof(string2), "Motivo: %s)",Motivo1);
format(string4, sizeof(string2), "Data: %d/%d/%d)",Dia1, Mes1, Ano1);
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
SendClientMessage(playerid,0xDEEE20FF,string1);
SendClientMessage(playerid,0xDEEE20FF,string2);
SendClientMessage(playerid,0xDEEE20FF,string3);
SendClientMessage(playerid,0xDEEE20FF,string4);
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
Kick(playerid);
}
Re: [AJUDA] Log Ban! -
Kasura - 15.11.2010
agora ta escrevendo e talz as mensagens ja setadas e lendo a data
mas
o resto n lк
Respuesta: [AJUDA] Log Ban! -
ipsBruno - 15.11.2010
Canabis seu cуdigo esta FAIL
Hum,Fodaun criou Thug Life City e nгo sabe formatar uma string usando arquivos ¬¬
Aconselho ler este tutorial
https://sampforum.blast.hk/showthread.php?tid=180237
Nada contra mais isto й tenso
pawn Код:
new
file[68],
name[24],
string[128]
;
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/sbadmin/Ban/%s.ini",name);
if(fexist(file))
{
new
Banidor[24],
Motivo[64],
Dia,
Mes,
Ano
;
format(Banidor,24,"%s", dini_Get(file,"Banidor"));
format(Motivo ,24,"%s", dini_Get(file,"Motivo"));
Dia = dini_Int(file,"Dia");
Mes = dini_Int(file,"Mкs");
Ano = dini_Int(file,"Ano");
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
format(string, sizeof(string), "Nick: %s Foi Banido do Servidor)",name);
SendClientMessage(playerid,0xDEEE20FF,string);
format(string, sizeof(string), "Por: %s)",Banidor);
SendClientMessage(playerid,0xDEEE20FF,string);
format(string, sizeof(string), "Motivo: %s)",Motivo);
SendClientMessage(playerid,0xDEEE20FF,string);
format(string, sizeof(string), "Data: %d/%d/%d)",Dia, Mes, Ano);
SendClientMessage(playerid,0xDEEE20FF,string);
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
Kick(playerid);
}
Re: [AJUDA] Log Ban! -
Canabis - 15.11.2010
fico interessante com format drakin ^^
mais eu fis com strmid ...
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[128], string1[128], string2[128], string3[128], string4[128];
format(file,sizeof(file),"/sbadmin/Ban/%s.ini",name);
if(fexist(file))
{
new Banido1[128], Banidor1[128], Motivo1[128], Dia1, Mes1, Ano1;
strmid(Banido1, dini_Get(file,"Banido"), 0, strlen(dini_Get(file,"Banido")), 128);
strmid(Banidor1, dini_Get(file,"Banidor"), 0, strlen(dini_Get(file,"Banidor")), 128);
strmid(Motivo1, dini_Get(file,"Motivo"), 0, strlen(dini_Get(file,"Motivo")), 128);
Dia1 = dini_Int(file,"Dia");
Mes1 = dini_Int(file,"Mкs");
Ano1 = dini_Int(file,"Ano");
format(string1, sizeof(string1), "Nick: %s Foi Banido do Servidor)",Banido1);
format(string2, sizeof(string2), "Por: %s)",Banidor1);
format(string3, sizeof(string2), "Motivo: %s)",Motivo1);
format(string4, sizeof(string2), "Data: %d/%d/%d)",Dia1, Mes1, Ano1);
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
SendClientMessage(playerid,0xDEEE20FF,string1);
SendClientMessage(playerid,0xDEEE20FF,string2);
SendClientMessage(playerid,0xDEEE20FF,string3);
SendClientMessage(playerid,0xDEEE20FF,string4);
SendClientMessage(playerid,0xDEEE20FF,"___________________________________________________________");
Kick(playerid);
}