Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #include <a_samp>
  2. #include <a_mysql>
  3.  
  4. #define DIALOGREGISTRO 0
  5.  
  6. new ConnectMYSQL;
  7.  
  8.  
  9.  
  10.  
  11.  
  12. public OnGameModeInit()
  13. {
  14. SetGameModeText("Blank Script");
  15. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  16.  
  17. ConnectMYSQL = mysql_connect("bruxoakise", "mysqlakisegm", "contas", "22097651"); //MySQL
  18. if(mysql_ping(ConnectMYSQL) < 1){
  19. printf("Não foi possível conectar-se com o MySQL.");
  20. SendRconCommand("exit"); }
  21.  
  22. return 1;
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29. public OnPlayerConnect(playerid)
  30. {
  31. ShowPlayerDialog(playerid, DIALOGREGISTRO, DIALOG_STYLE_PASSWORD, "TELA DE REGISTRO", "Crie uma senha abaixo:", "Confirmar", "Deslogar");
  32. return 1;
  33. }
  34.  
  35.  
  36.  
  37.  
  38.  
  39. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  40. {
  41. if(dialogid == DIALOGREGISTRO){
  42. if(response){
  43. if(strlen(inputtext) < 5 || strlen(inputtext) > 20){
  44. ShowPlayerDialog(playerid, DIALOGREGISTRO, DIALOG_STYLE_PASSWORD, "TELA DE REGISTRO", "Crie uma senha abaixo:", "Confirmar", "Deslogar");
  45. SendClientMessage(playerid, -1, "Coloque uma senha acima de 5 caractéres e abaixo de 20!");
  46. return 0; }
  47. else {
  48. new STRING[256], NICK[20];
  49. GetPlayerName(playerid, NICK, sizeof(NICK));
  50. SetPlayerPos(playerid, 0, 0, 0);
  51. mysql_format(ConnectMYSQL, STRING, "INSERT INTO `contas`(`Nick`, `Senha`, `Dinheiro`) VALUES ('%s','%s','%d'", NICK, inputtext, 500);
  52. mysql_function_query(ConnectMYSQL, STRING, false, "", "");
  53. return 1; }
  54. }
  55. }
  56. return 1;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement