How To Make A Rename Account Command
#5

You must have a player name in your .ini file so

Name = &&&&&&&&&&& // The name
pawn Код:
CMD:changename(playerid,params[])
{
    if(PlayerInfo[playerid][pCredits] >=1)
    {
     PlayerInfo[playerid][pCredits] -1;
     ShowPlayerDialog(playerid,DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Change Your Name", "Enter Your New Name Below",    "Next", "Cancel");

    }
    else{
    SendClientMessage(playerid,-1,"You Do Not Have The Correct Amount Of Credits 5©");
    }
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_LOGIN)
    {
        if(!response) // If they clicked 'Cancel' or pressed esc
        {
            SendClientMessage(playerid, COLOR_RED, "You Canceled Your Name Change");
        }
        else // Pressed ENTER or clicked 'Login' button
        {
            if(CheckPassword(playerid, inputtext))
            {
                            ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Notice", "You connected to the server", "Close", "");
            }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
    if(dialogid == DIALOG_WELCOME)
    {
        if(response) // If they clicked 'Yes' or pressed enter
        {
          PlayerInfo[playerid][Name] == inputtext;
        }
        else // Pressed ESC or clicked cancel
        {
            SendClientMessage(playerid, COLOR_RED, "You Canceled Your Name Change");
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
 
    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
Reply


Messages In This Thread
How To Make A Rename Account Command Using YINI - by gtakillerIV - 29.09.2012, 13:41
Re: How To Make A Rename Account Command - by Lordzy - 29.09.2012, 14:27
Re: How To Make A Rename Account Command - by gtakillerIV - 29.09.2012, 15:10
Re: How To Make A Rename Account Command - by gtakillerIV - 30.09.2012, 09:42
Re: How To Make A Rename Account Command - by zT KiNgKoNg - 30.09.2012, 10:54
Re: How To Make A Rename Account Command - by gtakillerIV - 30.09.2012, 11:15
Re: How To Make A Rename Account Command - by zT KiNgKoNg - 30.09.2012, 13:11

Forum Jump:


Users browsing this thread: 2 Guest(s)