Guest User

hed

a guest
Feb 10th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. switch( dialogid )
  2. {
  3. case DIALOG_REGISTER:
  4. {
  5. if (!response) return Kick(playerid);
  6. if(response)
  7. {
  8. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 6, 1, "Register", "You have entered an invalid password.\n""Type your password below to register a new account.", "Register", "Quit");
  9. new INI:File = INI_Open(UserPath(playerid));
  10. INI_SetTag(File,"data");
  11. INI_WriteInt(File,"Password",udb_hash(inputtext));
  12. INI_WriteInt(File,"Cash",0);
  13. INI_WriteInt(File,"Admin",0);
  14. INI_WriteInt(File,"Kills",0);
  15. INI_WriteInt(File,"Deaths",0);
  16. INI_Close(File);
  17.  
  18. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  19. SpawnPlayer(playerid);
  20. ShowPlayerDialog(playerid, 8, 0, "Success", "Great!You are now registerd", "Ok", "");
  21. }
  22. }
  23. case DIALOG_LOGIN:
  24. {
  25. if ( !response ) return Kick ( playerid );
  26. if( response )
  27. {
  28. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  29. {
  30. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  31. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  32. ShowPlayerDialog(playerid, 9, 0, "Success!", "You have successfully logged in!", "ok", "");
  33. }
  34. else
  35. {
  36. ShowPlayerDialog(playerid, 7, 1, "Login", "You have entered an incorrect password.\n""Type your password below to login.", "Login", "Quit");
  37. }
  38. return 1;
  39. }
  40. }
  41. }
  42. return 1;
  43. }
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment