Advertisement
Guest User

pin

a guest
Feb 13th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. if(dialogid == DIALOG_UNLOCKACC)
  2. {
  3. if ( !response )
  4. return ( 1 ) ;
  5.  
  6. new szPin;
  7.  
  8. if ( sscanf( inputtext, "d", szPin ) )
  9. return ShowPlayerDialog( playerid, DIALOG_UNLOCKACC, DIALOG_STYLE_PASSWORD, "Unlock Account", "Te rugam introdu mai jos PIN-ul contului tau.", "Acces", "Anuleaza" ) ;
  10.  
  11. if ( szPin != PlayerInfo[ playerid ][ SecurityCode ] )
  12. return SetTimerEx( "UnlockaccWait", 30000, false, "i", playerid ), SCM(playerid, COLOR_YELLOW, "Ai gresit codul PIN, te rugam asteapta 30 secunde.");
  13.  
  14. SetPVarInt( playerid, "AccountLocked", 0 ) ;
  15. SendClientMessage( playerid, -1, "Contul tau a fost deblocat cu succes." ) ;
  16. return ( 1 ) ;
  17. }
  18. if(dialogid == DIALOG_SET_PIN)
  19. {
  20. if ( !response )
  21. return ( 1 ) ;
  22.  
  23. new szPin, string[128];//,var[256];
  24. if ( sscanf( inputtext, "d", szPin ) )
  25. return ShowPlayerDialog( playerid, DIALOG_SET_PIN, DIALOG_STYLE_PASSWORD, "Lock Account", "Te rugam introdu mai jos un pin de 4 cifre.\n\n{FF0000}* Te rugam sa fii foarte atent si sa retii pin-ul.", "Seteaza", "Anuleaza" ) ;
  26.  
  27. if ( szPin > 9999 || szPin < 1000 )
  28. return ShowPlayerDialog( playerid, DIALOG_SET_PIN, DIALOG_STYLE_PASSWORD, "Lock Account", "Te rugam introdu mai jos un pin de 4 cifre.\n\n{FF0000}* Pin-ul trebuie sa fie format din 4 cifre.", "Seteaza", "Anuleaza" ) ;
  29. SetPVarInt( playerid, "sz_Setting_Pin", szPin ) ;
  30. format(string, sizeof string, "Esti sigur ca vrei sa-ti setezi codul pin %d ?", GetPVarInt( playerid, "sz_Setting_Pin" ) ) ;
  31. ShowPlayerDialog( playerid, DIALOG_SET_PIN_1, DIALOG_STYLE_MSGBOX, "Lock Account", string, "Seteaza", "Anuleaza" ) ;
  32. return ( 1 ) ;
  33. }
  34. if(dialogid == DIALOG_SET_PIN_1)
  35. {
  36. new string[128];
  37. if ( !response )
  38. return ( 1 ) ;
  39.  
  40. PlayerInfo[playerid][SecurityCode] = GetPVarInt( playerid, "sz_Setting_Pin" ) ;
  41. format( string, sizeof string, "UPDATE `users` SET `PIN` = %d WHERE `Name` = '%s'", GetPVarInt( playerid, "sz_Setting_Pin" ), GetName( playerid ) ) ;
  42. mysql_query(SQL, string);
  43. format( string, sizeof string, "Codul tau PIN este %d.", GetPVarInt( playerid, "sz_Setting_Pin" ) ) ;
  44. ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, "Lock Account", string, "Anuleaza", "" ) ;
  45. SetPVarInt( playerid, "AccountLocked", 1 ) ;
  46. DeletePVar( playerid, "sz_setting_Pin" ) ;
  47. Update(playerid, pSecurityCodex);
  48. return ( 1 ) ;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement