11.09.2016, 08:35
Hello, I've made a command, with a dialog. In the response of this dialog, it takes first 4 characters of the entered text (inputtext) and stores it in "pbInfo[pbid][pbPassword]"
When it sends me that message "you have changed the password to ...", I see it's changed to 3 characters only, not 4, why?
When it sends me that message "you have changed the password to ...", I see it's changed to 3 characters only, not 4, why?
PHP код:
case DIALOG_PB_EDITPW:
{
if(isnull(inputtext)) return ShowPlayerDialog(playerid, DIALOG_PB_EDITPW, DIALOG_STYLE_INPUT, ""COL_WHITE"Setting Paintball password", ""COL_WHITE"First 4 characters are going to be the password:\n\n"COL_RED"The password must be at least 4 characters.", "Select", "Done");
if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_PB_EDITPW, DIALOG_STYLE_INPUT, ""COL_WHITE"Setting Paintball password", ""COL_WHITE"First 4 characters are going to be the password:\n\n"COL_RED"The password must be at least 4 characters.", "Select", "Done");
new string[128], pbid = pInfo[playerid][InPBLobby], pw[4];
strmid(pw, inputtext, 0, 3);
pbInfo[pbid][pbPassword] = pw;
format(string, sizeof(string), "You have changed the lobby password to %s.", pbInfo[pbid][pbPassword]);
NGMSG(playerid, string);
}