CMD:changepass(playerid, params[]) { if(IsPlayerConnected(playerid)) { ShowPlayerDialog(playerid, 335, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); } return 1; }
fDialog(335) { if(response) { if(PlayerInfo[playerid][pPassword] == udb_hash(inputtext)) { ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write new password", "Ok", "Exit"); } else { ShowPlayerDialog(playerid, 335, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); } } return 1; }
fDialog(342) { if(response) { new string[69]; if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); if(strlen(inputtext) < 6 || strlen(inputtext) > 20) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); if(strfind(inputtext, "%") != -1) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); PlayerInfo[playerid][pPassword] = udb_hash(inputtext); //strmid(PlayerInfo[playerid][pPassword], inputtext, 0, strlen(inputtext), 255); format(string, sizeof(string), "New password is %s", inputtext); SCM(playerid, COLOR_WHITE,string); } return 1; }
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); Not functioning, press empty dialog it accepts
i also have some trouble with dialogs. ( Not the same but post it here because i don't think its needed to create a new topic)
I'm trying to get a dialog triggerd on an other player when using iam using a command. Example. type /Showrules 1 and it opens the rules dialog for Player with ID 1. any one have any idea? |
CMD:showrules(playerid, params[]) { Dialog_Show(playerid, RulesOtherPlayer, DIALOG_STYLE_INPUT, ""EMBED_YELLOW"Player Selection:", "Please input player ID!", "Next", "Cancel"); return 1; }
Dialog:RulesOtherPlayer(playerid, response, listitem, inputtext[]) { if(response) { new Player = strval(inputtext); SendClientMessage(Player, -1, "Message") } return 1; }
Код:
CMD:changepass(playerid, params[]) { if(IsPlayerConnected(playerid)) { ShowPlayerDialog(playerid, 335, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); } return 1; } Код:
fDialog(335) { if(response) { if(PlayerInfo[playerid][pPassword] == udb_hash(inputtext)) { ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write new password", "Ok", "Exit"); } else { ShowPlayerDialog(playerid, 335, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); } } return 1; } Код:
fDialog(342) { if(response) { new string[69]; if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); if(strlen(inputtext) < 6 || strlen(inputtext) > 20) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); if(strfind(inputtext, "%") != -1) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); PlayerInfo[playerid][pPassword] = udb_hash(inputtext); //strmid(PlayerInfo[playerid][pPassword], inputtext, 0, strlen(inputtext), 255); format(string, sizeof(string), "New password is %s", inputtext); SCM(playerid, COLOR_WHITE,string); } return 1; } Код:
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); Not functioning, press empty dialog it accepts |
fDialog(342) { if(response) { new newpass = strlen(inputtext),string[69]; if(!strlen(inputtext)) { ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", "Exit"); return 1; } else if(!(6 <= newpass <= 20)) { ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", "Exit"); return 1; } else if(strfind(inputtext, "%") != -1) { ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", "Exit"); return 1; } PlayerInfo[playerid][pPassword] = udb_hash(inputtext); //strmid(PlayerInfo[playerid][pPassword], inputtext, 0, strlen(inputtext), 255); format(string, sizeof(string), "New password is %s", inputtext); SCM(playerid, COLOR_WHITE,string); } return 1 }