How would i turn these into dialogs
#9

So like this:

pawn Код:
if(dialogid == 2)
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
    {
        SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
        return 1;
    }
    else if(!params[0])
    {
        SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /register [password]");
        return 1;
    }
    else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
    {
    new string[200];
      format(string, sizeof(string), "ERROR: Password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else
    {
        new password = num_hash(params);
        gPlayerInfo[playerid][PLAYER_PASS] = password;
        gPlayerInfo[playerid][PLAYER_REGGED] = 1;
        gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
        GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
        new string[256];
        format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
        SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
        return 1;
    }
}

if(dialogid == 2)
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
    {
        SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
        return 1;
    }
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
    {
        SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-in.");
        return 1;
    }
    else if(!params[0])
    {
        SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /login [password]");
        return 1;
    }
    else
    {
        new password = num_hash(params);
        if(gPlayerInfo[playerid][PLAYER_PASS] == password)
        {
          gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
          SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged in to your account.");
          return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
          return 1;
        }
    }
}
Reply


Messages In This Thread
How would i turn these into dialogs - by Torran - 23.01.2010, 22:52
Re: How would i turn these into dialogs - by MaykoX - 24.01.2010, 06:36
Re: How would i turn these into dialogs - by Torran - 24.01.2010, 11:41
Re: How would i turn these into dialogs - by MadeMan - 24.01.2010, 12:42
Re: How would i turn these into dialogs - by Torran - 24.01.2010, 12:45
Re: How would i turn these into dialogs - by MadeMan - 24.01.2010, 12:53
Re: How would i turn these into dialogs - by Torran - 24.01.2010, 12:56
Re: How would i turn these into dialogs - by mansonh - 24.01.2010, 12:57
Re: How would i turn these into dialogs - by Torran - 24.01.2010, 13:15
Re: How would i turn these into dialogs - by mansonh - 24.01.2010, 13:20

Forum Jump:


Users browsing this thread: 1 Guest(s)