10.07.2016, 12:28
Quote:
|
You are correct. Is that a good idea? Want to prevent half-registered members. I know you can make them finish the dialogs they didn't, but I don't really want that. Want it all to be done at once.
Update: I tried to temporarily store the data, but apparently that didn't work out well haha. Any suggestions? Want it to be as efficient as possible. |
Код:
//Globals #define MAX_REGISTRATION_PASSWORD 128 + 1 //See Dialog input limit #define MAX_REGISTRATION_ORIGIN 128 + 1 //See Dialog input limit enum REGISTRATION_ENUM { PASSWORD[MAX_REGISTRATION_PASSWORD], bool:GENDER, //False = male, true = female YEAR, ORIGIN[MAX_REGISTRATION_ORIGIN] } new registrationInfo[MAX_PLAYERS][REGISTRATION_ENUM]; //OnPlayerConnect (reset variables before showing the dialogs) format(registrationInfo[playerid][PASSWORD], MAX_REGISTRATION_PASSWORD, ""); registrationInfo[playerid][GENDER] = false; registrationInfo[playerid][YEAR] = 0; format(registrationInfo[playerid][ORIGIN], MAX_REGISTRATION_ORIGIN, ""); //OnDialogResponse //Password dialog //Successfull format(registrationInfo[playerid][PASSWORD], MAX_REGISTRATION_PASSWORD, myHashFunction(inputtext)); //Unsuccessfull kick or reshown dialog to try again //Gender dialog //Successfull registrationInfo[playerid][GENDER] = response; //Female //Unsuccessfull registrationInfo[playerid][GENDER] = response; //Male //Year dialog //Successfull registrationInfo[playerid][YEAR] = strval(inputtext); //Unsuccessfull kick or reshown dialog to try again //Origin dialog //Successfull format(registrationInfo[playerid][ORIGIN], MAX_REGISTRATION_ORIGIN, inputtext); push query //Unsuccessfull kick or reshown dialog to try again
.


