ShowMainMenuDialog(playerid, frame) { new titlestring[64]; new string[256]; switch(frame) { case 1: { new ip[32]; GetPlayerIp(playerid, ip, 32); format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid)); format(string, sizeof(string), "Welcome to High Street's Roleplay, %s.\n\nIP Address: 66.146.239.20:7777\n\nThe name that you are using is registered, please enter a password to login:", GetPlayerNameEx(playerid), ip); ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Login","Exit"); } case 2: { new ip[32]; GetPlayerIp(playerid, ip, 32); format(titlestring, sizeof(titlestring), "Register - %s", GetPlayerNameEx(playerid)); format(string, sizeof(string), "High Street's Roleplay, %s.\n\nIP Address: 66.146.239.20:7777 %s\n\nYou may register an account by entering a desired password here:", GetPlayerNameEx(playerid), ip); ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_PASSWORD,titlestring,string,"Register","Exit"); } case 3: { new ip[32]; GetPlayerIp(playerid, ip, 32); format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid)); format(string, sizeof(string), "Invalid Password!\n\nWelcome to High Street's Roleplay, %s.\n\nIP Address: 66.146.239.20:7777 %s\n\nThe name that you are using is registered, please enter a password to login:", GetPlayerNameEx(playerid), ip); ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Login","Exit"); } } }
if(dialogid == MAINMENU || dialogid == MAINMENU2) { if(dialogid == MAINMENU) { if( response == 0 ) { SendClientMessageEx(playerid, COLOR_RED, "SERVER: You have been kicked out automatically."); Kick(playerid); } else { if(strlen(inputtext)) { new tmppass[64]; strmid(tmppass, inputtext, 0, strlen(inputtext), 255); Encrypt(tmppass); if(PlayerInfo[playerid][pAdmin] > 0) { ShowPlayerDialog(playerid, ADMINPIN, DIALOG_STYLE_INPUT, "Admin Pin Confirmation", "Please enter the pin that was assigned to your administrator account to continue.", "Login", "Cancel"); PinLoginPass[playerid] = tmppass; SetTimerEx("AdminPinLogin",50*1000,0,"i",playerid); } else { OnPlayerLogin(playerid,tmppass); } } else { new loginname[64]; GetPlayerName(playerid,loginname,sizeof(loginname)); ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,"Login","Incorrect password. \n \nThat name is registered, you may now enter your password.","Login","Exit"); gPlayerLogTries[playerid] += 1; if(gPlayerLogTries[playerid] == 2) { SendClientMessageEx(playerid, COLOR_RED, "SERVER: Wrong password, you have been kicked out automatically."); Kick(playerid); } } } } if(dialogid == MAINMENU2) { if(strlen(inputtext)) { GetPlayerName(playerid, sendername, sizeof(sendername)); if(doesAccountExist(sendername)) { SendClientMessageEx(playerid, COLOR_YELLOW, "That username is already taken, please choose a different one."); return 1; } new tmppass[64]; strmid(tmppass, inputtext, 0, strlen(inputtext), 255); Encrypt(tmppass); OnPlayerRegister(playerid,tmppass); } } }
if(strlen(inputtext))
if(!strcmp(inputtext,password,false))
//the "password" would be the variable to check their account's password
//the "password" would be the variable to check their account's password
|
and now let me just quote my self.
you will need to get the players save password and replace it with what ever variable you load it as |