08.06.2013, 16:27
So, using the help of the samp wiki, I've managed to make a login command-thingy. The problem is, when I press the login button when the "input box" is empty, it automatically refers it to me.
Here's the code:
Thanks for helping.
Here's the code:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_LOGIN) { if(!response) // If they clicked 'Cancel' or pressed esc { SendClientMessage(playerid, 0xFF0000FF, "LOGIN FAILED."); } else // Pressed ENTER or clicked 'Login' button { if(VilcsiTHPassword(playerid, inputtext)) { SendClientMessage(playerid, 0xFF0000FF, "You are now logged in as VilcsiTH!"); } else if(SamuelPassword(playerid, inputtext)) { SendClientMessage(playerid, 0xFF0000FF, "You are now logged in as Samuel!"); } else { SendClientMessage(playerid, 0xFF0000FF, "LOGIN FAILED."); // Re-show the login dialog ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Please enter your password:", "Login", "Cancel"); } } return 1; } return 0; }