[Ajuda] Nick em Dialog
#1

Olб.. gostaria de por meu Comando em Dialog.. mais n to conseguindo :/
meu comando normal:

pawn Код:
CMD:mudarnick (playerid, params[])
{
    new str[60], str2[60], name[32];

    if(isnull(params)) return SendClientMessage(playerid, -1, "/mudarnick [novo nick]");

    GetPlayerName(playerid, name, sizeof(name));

    format(str, sizeof(str), "LLADMIN/Contas/%s.txt", name);

    if(!DOF2_FileExists(str)) return SendClientMessage(playerid, -1, "Vocк nгo possui uma conta.");

    format(str2, sizeof(str2), "LLADMIN/Contas/%s.txt", params);

    DOF2_RenameFile(str, str2);

    SetPlayerName(playerid, params);

    return true;
}
Reply
#2

Vocк deve usar a funзгo ShowPlayerDialog, vocк pode ver os parвmetros e exemplo de script na samp wiki
Reply
#3

Fiz uma atualizaзгo no T-Admin onde o comando /mudarnick й em dialog.. Estude o cуdigo.
Reply
#4

PHP код:
#define DIALOG_NICK 150
CMD:mudarnick (playerid)
{
    
ShowPlayerDialog(playeridDIALOG_NICKDIALOG_STYLE_INPUT"Mudar nick""Digite abaixo seu novo nick""Mudar""Fechar");
    return 
true;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_NICK:
        {
           new 
str[60], str2[60], name[32], string[40];
           if(!
response) return SendClientMessage(playerid, -1"Vocк nгo quis mudar o nick");
           if(!
strlen(inputtext)) return SendClientMessage(playerid, -1"Digite um nick");
           if(
strlen(inputtext) < || strlen(inputtext) > 24 &&!strlen(inputtext)) return SendClientMessage(playerid, -1"Digite um nick entre 5 e 24 caracteres");
           
GetPlayerName(playeridnamesizeof(name));
           
format(strsizeof(str), "LLADMIN/Contas/%s.txt"name);
           if(!
DOF2_FileExists(str)) return SendClientMessage(playerid, -1"Vocк nгo possui uma conta.");
           
format(str2sizeof(str2), "LLADMIN/Contas/%s.txt"inputtext);
           
DOF2_RenameFile(strstr2);
           
SetPlayerName(playeridinputtext);
           
format(stringsizeof(string), "Vocк mudou seu nick com sucesso, nick novo: %s"inputtext);
           
SendClientMessage(playerid, -1string);
        }
    }
    return 
1;

Reply
#5

Fiz um esboзo

http://pastebin.com/9NaVBiEW
Reply
#6

mt obrigado LockedLucas e ByKiLler
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)