[Pedido]Refencia ao registrar - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido]Refencia ao registrar (
/showthread.php?tid=314206)
[Pedido]Refencia ao registrar -
makino - 29.01.2012
Galera eu keria um dialogo onde o player deve digitar quem o indico e o texto seja salvo em um arquivo .ini e isso deva aparecer apenas ao registrar

obrigado
Re: [Pedido]Refencia ao registrar - rjjj - 29.01.2012
Isto deve resolver o seu problema

.
Coloque

:
pawn Код:
//No OnPlayerRequestClass:
new NickName[30];
GetPlayerName(playerid, NickName, 30);
strcat(NickName, ".ini");
if(!fexist(NickName)) ShowPlayerDialog(playerid, 230, DIALOG_STYLE_INPUT, "Pergunta", "Quem o chamou para jogar no servidor ?", "Confirmar", "Ninguйm");
//E, no OnDialogResponse:
if(dialogid == 230)
{
new NickName[30];
GetPlayerName(playerid, NickName, 30);
strcat(NickName, ".ini");
new File:Referencia = fopen(NickName, io_write);
if(response) fwrite(Referencia, inputtext);
else fwrite(Referencia, "Ninguйm");
fclose(Referencia);
}
O cуdigo acima criarб um arquivo de nome igual ao do jogador e de extensгo .ini na pasta scriptfiles.
Espero ter ajudado

.