Dialogo -
MatheusAlcapone - 04.10.2012
Pessoal eu criei um sistema de ban atй ai tudo ok, mais sу que quando eu vou mandar a mensagem pro player quando ele tenta logar banido o dialogo buga, olha o que acontece
Olha o que acontece vou deixar o cуdigo abaixo pra ver se alguйm acha o que esta errado.
Cуdigo:
pawn Код:
new PlayerBan[128];
GetPlayerIp(playerid,PlayerBan,sizeof(PlayerBan));
format(PlayerBan, 128,"Bans/%s.ini",PlayerBan);
if(DOF2_FileExists(PlayerBan))
{
new str[128];
format(str,128,"Seu Nick '%s' esta banido!\n", DOF2_GetInt(PlayerBan,"Nome"));
strcat(str,str);
format(str,128,"Admin que te baniu '%s'\n", DOF2_GetInt(PlayerBan,"Admin"));
strcat(str,str);
format(str,128,"Motivo '%s'\n", DOF2_GetInt(PlayerBan,"Motivo"));
strcat(str,str);
format(str,128,"Data do ban '%d'\n", DOF2_GetInt(PlayerBan,"Data"));
strcat(str,str);
format(str,128,"Hora do ban '%02d'", DOF2_GetInt(PlayerBan,"Horas"));
strcat(str,str);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Banido",str , "Ok", "Ok");
Kick(playerid);
}
Re: Dialogo -
Coringa_Vilao - 04.10.2012
Olб vocк so adc esse codigo ou adc mais outro ?
Re: Dialogo -
MatheusAlcapone - 04.10.2012
Isso esta no OnPlayerConnect tem mais outros cуdigos, mais o de ban й sу esse
Re: Dialogo -
FenixBorn - 04.10.2012
tenta assim,,fiz rapido n sei se vai funfar
pawn Код:
new PlayerBan[128];
GetPlayerIp(playerid,PlayerBan,sizeof(PlayerBan));
format(PlayerBan, 128,"Bans/%s.ini",PlayerBan);
if(DOF2_FileExists(PlayerBan))
{
new string[128];
format(string,128,"Seu Nick '%s' esta banido!\n", DOF2_GetInt(PlayerBan,"Nome"));
strcat(PlayerBan,string);
format(string,128,"Admin que te baniu '%s'\n", DOF2_GetInt(PlayerBan,"Admin"));
strcat(PlayerBan,string);
format(string,128,"Motivo '%s'\n", DOF2_GetInt(PlayerBan,"Motivo"));
strcat(PlayerBan,string);
format(string,128,"Data do ban '%d'\n", DOF2_GetInt(PlayerBan,"Data"));
strcat(PlayerBan,string);
format(string,128,"Hora do ban '%02d'", DOF2_GetInt(PlayerBan,"Horas"));
strcat(PlayerBan,string);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Banido",str , "Ok", "");
Kick(playerid);
}
Re: Dialogo -
MatheusAlcapone - 04.10.2012
continua a mesma coisa
Re: Dialogo -
Coringa_Vilao - 04.10.2012
pawn Код:
new PlayerBan[128];
GetPlayerIp(playerid,PlayerBan,sizeof(PlayerBan));
format(PlayerBan, 128,"Bans/%s.ini",PlayerBan);
if(DOF2_FileExists(PlayerBan))
{
new string[128];
format(string,128,"Seu Nick '%s' esta banido!\n", DOF2_GetInt(playerid,"Nome"));
strcat(PlayerBan,string);
format(string,128,"Admin que te baniu '%s'\n", DOF2_GetInt(PlayerBan,"Admin"));
strcat(PlayerBan,string);
format(string,128,"Motivo '%s'\n", DOF2_GetInt(PlayerBan,"Motivo"));
strcat(PlayerBan,string);
format(string,128,"Data do ban '%d'\n", DOF2_GetInt(PlayerBan,"Data"));
strcat(PlayerBan,string);
format(string,128,"Hora do ban '%02d'", DOF2_GetInt(PlayerBan,"Horas"));
strcat(PlayerBan,string);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Banido",str , "Ok", "");
Kick(playerid);
}
}
return 0;
}
to tentando sou iniciante nгo me leva a mal mais estou tentando... ver se da serto ai
Re: Dialogo -
FenixBorn - 04.10.2012
Tinha eskecido de mudar uma coisinha,,tenta ssim
pawn Код:
new PlayerBan[128];
GetPlayerIp(playerid,PlayerBan,sizeof(PlayerBan));
format(PlayerBan, 128,"Bans/%s.ini",PlayerBan);
if(DOF2_FileExists(PlayerBan))
{
new string[128];
format(string,128,"Seu Nick '%s' esta banido!\n", DOF2_GetInt(PlayerBan,"Nome"));
strcat(PlayerBan,string);
format(string,128,"Admin que te baniu '%s'\n", DOF2_GetInt(PlayerBan,"Admin"));
strcat(PlayerBan,string);
format(string,128,"Motivo '%s'\n", DOF2_GetInt(PlayerBan,"Motivo"));
strcat(PlayerBan,string);
format(string,128,"Data do ban '%d'\n", DOF2_GetInt(PlayerBan,"Data"));
strcat(PlayerBan,string);
format(string,128,"Hora do ban '%02d'", DOF2_GetInt(PlayerBan,"Horas"));
strcat(PlayerBan,string);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Banido",PlayerBan , "Ok", "");
Kick(playerid);
}
Re: Dialogo -
MatheusAlcapone - 04.10.2012
nenhum dos dois olha o que acontece agora
Imagem
Re: Dialogo -
tonisantolia - 04.10.2012
isso e mal uso do strcat:
pawn Код:
new str[128],DialogBan[300];
format(str,128,"Seu Nick '%s' esta banido!\n", DOF2_GetInt(PlayerBan,"Nome"));
strcat(DialogBan,str);
format(str,128,"Admin que te baniu '%s'\n", DOF2_GetInt(PlayerBan,"Admin"));
strcat(DialogBan,str);
format(str,128,"Motivo '%s'\n", DOF2_GetInt(PlayerBan,"Motivo"));
strcat(DialogBan,str);
format(str,128,"Data do ban '%d'\n", DOF2_GetInt(PlayerBan,"Data"));
strcat(DialogBan,str);
format(str,128,"Hora do ban '%02d'", DOF2_GetInt(PlayerBan,"Horas"));
strcat(DialogBan,str);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Banido",DialogBan , "Ok", "");
Re: Dialogo -
hard_dalzot - 04.10.2012
pawn Код:
new PlayerBan[128];
GetPlayerIp(playerid,PlayerBan,sizeof(PlayerBan));
format(PlayerBan, 128,"Bans/%s.ini",PlayerBan);
if(DOF2_FileExists(PlayerBan))
{
new string0[128],string1[128],string2[128],string3[128],string4[128];
format(string0,128,"Seu Nick '%s' esta banido!\n", DOF2_GetInt(PlayerBan,"Nome"));
strcat(PlayerBan,string0);
format(string1,128,"Admin que te baniu '%s'\n", DOF2_GetInt(PlayerBan,"Admin"));
strcat(PlayerBan,string1);
format(string2,128,"Motivo '%s'\n", DOF2_GetInt(PlayerBan,"Motivo"));
strcat(PlayerBan,string2);
format(string3,128,"Data do ban '%d'\n", DOF2_GetInt(PlayerBan,"Data"));
strcat(PlayerBan,string3);
format(string4,128,"Hora do ban '%02d'", DOF2_GetInt(PlayerBan,"Horas"));
strcat(PlayerBan,string4);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Banido",PlayerBan , "Ok", "");
Kick(playerid);
}
Tenta usar assim mano