Advertisement
Guest User

Multumesc mult

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