Advertisement
Guest User

sfafas

a guest
Aug 5th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. case DIALOG_LOGIN:
  2. {
  3. if(!response) return Kick(playerid);
  4. mysql_format(gConnectionHandle, Query,sizeof(Query)," SELECT * FROM `users` WHERE Username = '%e' AND Password = '%e' ",GetName(playerid), inputtext);
  5. mysql_function_query(gConnectionHandle, Query, false, "LoginPlayer","ds", playerid, inputtext);
  6. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","Your account is already registered\nPlease type your password to login","Login","Quit");
  7. }
  8. case DIALOG_REGISTER:
  9. {
  10. if(!response) return Kick(playerid);
  11. new IP[50];
  12. GetPlayerIp(playerid, IP, sizeof(IP));
  13. mysql_format(gConnectionHandle, Query,sizeof(Query), "INSERT INTO `users`(`Username`,`Password`,`Money`,`Score`,`Admin`,`IP`) VALUES('%e', md5('%e'), 1000, 0, 0, 0, 0, ('%e')",GetName(playerid), inputtext, IP);
  14. mysql_function_query(gConnectionHandle, Query, false,"OnQueryFinish","s", Query);
  15. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register","Your account is not registered\nPlease type your password to register","Register","Quit");
  16. SpawnPlayer(playerid);
  17. mysql_free_result();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement