Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(dialogid == DIALOG_NEWPASS)
- {
- if(response)
- {
- new length = strlen(inputtext);
- if(length == 0 || length > 15)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Please enter another password (maximum 15 characters).");
- ShowPlayerDialog(playerid, DIALOG_NEWPASS,DIALOG_STYLE_INPUT, "Change password:","Type in box your new password:","Done","Close");
- return 1;
- }
- if(strlen(inputtext) > 1 && strlen(inputtext) < 16)
- {
- new tmppass[64],namee[30],playerip[16];
- mysql_real_escape_string(inputtext, tmppass);
- strmid(PlayerInfo[playerid][pKey], tmppass, 0, strlen(tmppass), 255);
- format(string,sizeof(string),"Your new password is %s.",tmppass);
- SendClientMessage(playerid, COLOR_YELLOW,string);
- GetPlayerName(playerid, namee, sizeof(namee));
- GetPlayerIp(playerid, playerip, sizeof(playerip));
- format(string,sizeof(string),"%s[user:%d] changed his password. IP: %s",namee,PlayerInfo[playerid][pSQLID],playerip);
- ABroadCast(COLOR_YELLOW, string,1);
- GetPlayerName(playerid,sendername,sizeof(sendername));
- new str2[240];
- mysql_format(SQL, str2, sizeof(str2), "UPDATE users SET `password`='%s' WHERE `name`='%s'",PlayerInfo[playerid][pKey], PlayerInfo[playerid][pNormalName]);
- mysql_tquery(SQL,str2,"","");
- return 1;
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_NEWPASS,DIALOG_STYLE_INPUT, "Change password:","Type in box your new password:","Done","Close");
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement