Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_LOGIN)
- {
- if(!response) return Kick(playerid);
- mysql_format(gConnectionHandle, Query,sizeof(Query)," SELECT * FROM `users` WHERE Username = '%e' AND Password = '%e' ",GetName(playerid), inputtext);
- mysql_function_query(gConnectionHandle, Query, false, "LoginPlayer","ds", playerid, inputtext);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","Your account is already registered\nPlease type your password to login","Login","Quit");
- }
- if(dialogid == DIALOG_REGISTER)
- {
- if(!response) return Kick(playerid);
- new IP[50];
- GetPlayerIp(playerid, IP, sizeof(IP));
- 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);
- mysql_function_query(gConnectionHandle, Query, false,"OnQueryFinish","s", Query);
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register","Your account is not registered\nPlease type your password to register","Register","Quit");
- SpawnPlayer(playerid);
- mysql_free_result();
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement