Help Converting Dialog To CMD
#1

Hey I got this code:
Код:
if(dialogid == 201)
    {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,201,DIALOG_STYLE_INPUT,"Registration","ERROR: You did not enter a password.\nPlease enter a password to register this account!","Register","Cancel");
        new playerfile[128], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(playerfile, sizeof(playerfile), "EAdmin/Users/%s.ini",pname);
         if(dini_Exists(playerfile)) return SendClientMessage(playerid, red, "You are already registered!");
        new playerip[20];
        GetPlayerIp(playerid, playerip, sizeof(playerip));
        dini_Create(playerfile);
          dini_IntSet(playerfile, "Password", udb_hash(inputtext));
        dini_Set(playerfile, "Ip", playerip);
        dini_IntSet(playerfile, "Level", 0);
        dini_IntSet(playerfile, "Cash", 0);
        dini_IntSet(playerfile, "Score", 0);
        logged[playerid] = 1;
        SendClientMessage(playerid, yellow, "You have registered your account! You have also been logged in.");
    }
    if(dialogid == 200)
    {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,200,DIALOG_STYLE_INPUT,"Login","ERROR: You did not enter a password.\nPlease enter a password to login to this account!","Login","Cancel");
        new playerfile[100], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(playerfile, sizeof(playerfile), "EAdmin/Users/%s.ini",pname);
         if(!dini_Exists(playerfile)) return SendClientMessage(playerid, red, "This account is not yet registered, please type /register.");
        new tmp[256];
        tmp = dini_Get(playerfile, "Password");
        if(udb_hash(inputtext) == strval(tmp))
        {
        new playerip[20];
        GetPlayerIp(playerid, playerip, sizeof(playerip));
        level[playerid] = dini_Int(playerfile, "Level");
        logged[playerid] = 1;
        dini_Set(playerfile, "Ip", playerip);
        GivePlayerMoney(playerid, dini_Int(playerfile, "Cash"));
        SetPlayerScore(playerid, dini_Int(playerfile, "Score"));
        logged[playerid] = 1;
        SendClientMessage(playerid, yellow, "You have logged in!");
        } else return ShowPlayerDialog(playerid,200,DIALOG_STYLE_INPUT,"Login","ERROR: Invalid Password.\nPlease enter a password to login to this account!","Login","Cancel");
    }
I want to switch these to a command like /login [password] and /register [password]

Can anyone help me out PS: I tried it but I failed
Reply


Messages In This Thread
Help Converting Dialog To CMD - by Guest3598475934857938411 - 28.09.2010, 20:52
Re: Help Converting Dialog To CMD - by samgreen - 29.09.2010, 04:34
Re: Help Converting Dialog To CMD - by LarzI - 29.09.2010, 06:43
Re: Help Converting Dialog To CMD - by Rachael - 29.09.2010, 06:51
Re: Help Converting Dialog To CMD - by LarzI - 29.09.2010, 06:53
Re: Help Converting Dialog To CMD - by Rachael - 29.09.2010, 06:59
Re: Help Converting Dialog To CMD - by LarzI - 29.09.2010, 07:02
Re: Help Converting Dialog To CMD - by samgreen - 29.09.2010, 07:05
Re: Help Converting Dialog To CMD - by Rachael - 29.09.2010, 14:43
Re: Help Converting Dialog To CMD - by Guest3598475934857938411 - 29.09.2010, 15:11

Forum Jump:


Users browsing this thread: 1 Guest(s)