Advertisement
Guest User

Untitled

a guest
Jun 6th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. if(dialogid == DIALOG_NEWPASS)
  2. {
  3. if(response)
  4. {
  5. new length = strlen(inputtext);
  6. if(CheckDialogBug(inputtext)) return SendClientMessage(playerid, 0, "{FFFFFF}You can't use '%' in strings.");
  7.  
  8.  
  9. if(length == 0 || length > 15)
  10. {
  11. SendClientMessage(playerid, COLOR_WHITE, "Please enter another password (maximum 15 characters).");
  12. ShowPlayerDialog(playerid, DIALOG_NEWPASS,DIALOG_STYLE_INPUT, "Change password:","Type in box your new password:","Done","Close");
  13. return 1;
  14. }
  15. if(strlen(inputtext) > 1 && strlen(inputtext) < 16)
  16. {
  17. new tmppass[64],namee[30],playerip[16];
  18. mysql_real_escape_string(inputtext, tmppass);
  19. strmid(PlayerInfo[playerid][pKey], tmppass, 0, strlen(tmppass), 255);
  20. format(string,sizeof(string),"Your new password is %s.",tmppass);
  21. SendClientMessage(playerid, COLOR_YELLOW,string);
  22. GetPlayerName(playerid, namee, sizeof(namee));
  23. GetPlayerIp(playerid, playerip, sizeof(playerip));
  24. format(string,sizeof(string),"%s[user:%d] changed his password. IP: %s",namee,PlayerInfo[playerid][pSQLID],playerip);
  25. ABroadCast(COLOR_YELLOW, string,1);
  26. GetPlayerName(playerid,sendername,sizeof(sendername));
  27. new str2[240];
  28. mysql_format(SQL, str2, sizeof(str2), "UPDATE users SET `password`='%s' WHERE `name`='%s'",PlayerInfo[playerid][pKey], PlayerInfo[playerid][pNormalName]);
  29. mysql_tquery(SQL,str2,"","");
  30. return 1;
  31. }
  32. else
  33. {
  34. ShowPlayerDialog(playerid, DIALOG_NEWPASS,DIALOG_STYLE_INPUT, "Change password:","Type in box your new password:","Done","Close");
  35. return 1;
  36. }
  37. }
  38. return 1;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement