Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <a_mysql>
- #define DIALOGREGISTRO 0
- new ConnectMYSQL;
- public OnGameModeInit()
- {
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- ConnectMYSQL = mysql_connect("bruxoakise", "mysqlakisegm", "contas", "22097651"); //MySQL
- if(mysql_ping(ConnectMYSQL) < 1){
- printf("Não foi possível conectar-se com o MySQL.");
- SendRconCommand("exit"); }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- ShowPlayerDialog(playerid, DIALOGREGISTRO, DIALOG_STYLE_PASSWORD, "TELA DE REGISTRO", "Crie uma senha abaixo:", "Confirmar", "Deslogar");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOGREGISTRO){
- if(response){
- if(strlen(inputtext) < 5 || strlen(inputtext) > 20){
- ShowPlayerDialog(playerid, DIALOGREGISTRO, DIALOG_STYLE_PASSWORD, "TELA DE REGISTRO", "Crie uma senha abaixo:", "Confirmar", "Deslogar");
- SendClientMessage(playerid, -1, "Coloque uma senha acima de 5 caractéres e abaixo de 20!");
- return 0; }
- else {
- new STRING[256], NICK[20];
- GetPlayerName(playerid, NICK, sizeof(NICK));
- SetPlayerPos(playerid, 0, 0, 0);
- mysql_format(ConnectMYSQL, STRING, "INSERT INTO `contas`(`Nick`, `Senha`, `Dinheiro`) VALUES ('%s','%s','%d'", NICK, inputtext, 500);
- mysql_function_query(ConnectMYSQL, STRING, false, "", "");
- return 1; }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement