MySql estб setando o e-mail mбs nгo estб chamando dialog -
[BOPE]Seu._.Madruga - 03.03.2014
Bom galera oque estб acontecendo й o seguinte, eu comecei a passar meu GM que criei para MySql e estou tendo uns problemas.
Quem ajudar ganha + Rep.
Tipo vem a dialogid Registro ai verifica se o player jб tem conta no banco de dados se ele nгo tiver cria a conta certinho, depois vem a dialog para informar o e-mail para recuperaзгo de senha, estб setando certinho o e-mail no banco de dados do player porйm nгo estб chamando a dialog id que vem logo abaixo que й a dialog Regras.
Informaзхes:
Nome do DB: samp
DB definido como: dbhandle
Nome da tabela: usuarios
Este й o cуdigo que estou usando, porйm quando retiro ele a dialog regras aparece certinho. Oque estб errado?
PHP Code:
new query[1024];
format(query, sizeof(query), "UPDATE `usuarios` SET `email` = '%s' WHERE `usuario` = '%s'", inputtext, aname);
mysql_query(dbhandle, query,false);
Eu fiz um teste abaixo, colocando uma sendclient em cada lugar da dialog Regras. para ver se por acaso chega-se ali e se eu aceita-se ou recusa-se as regras, iria aparecer a mensagem no chat pra mim.
Porйm nгo aparece a mensagem, e a dialog sу aparece se eu colocar o script do mysql abaixo da dialog. Sу que nгo adianta pois se eu clicar em qualquer botгo "aceitar" ou "recusar" nгo estб chamando a sendclient que eu puis.
PHP Code:
if( dialogid == DIALOG_REGRAS )
{
if( response )
{
SendClientMessage(playerid, -1, "CHEGOU AQUI");
new string1 [ 266 ], aname [ MAX_PLAYER_NAME ];
GetPlayerName( playerid, aname, sizeof( aname ) ) ;
SendClientMessage( playerid,-1,"{FF0000} [ > ] Vocк aceitou as regras caso vocк nгo cumpra elas, sera punido( a ) !" ) ;
format( string1, sizeof( string1 ) ,"{FFFFFF}• Olб {FFE583}%s{FFFFFF} nos informe a sua sexualidade.\n\nEscolha:\n\nMas para {48A8FF}Masculino\n{FFFFFF}Fem para {FFA8FF}Feminino",aname ) ;
ShowPlayerDialog( playerid, DIALOG_SEXUALIDADE, DIALOG_STYLE_MSGBOX, "{FFFFFF}•» {FFFF00}B{00FF00}r{3366FF}a{FFFF00}s{00FF00}i{3366FF}l {FFFFFF}PlayBoy City RPG {FF0000}№.°™", string1, "Mas", "Fem" ) ;
}
else
{
SendClientMessage(playerid, -1, "CHEGOU AQUI 2");
new stringz [ 148 ];
format( stringz, sizeof( stringz ) ," [ x ] O( a ) player %s foi kickado( a ) por nгo aceitar as regras." ) ;
SendClientMessageToAll( -1, stringz ) ;
Kick( playerid ) ;
}
}
Re: MySql estб setando o e-mail mбs nгo estб chamando dialog -
mau.tito - 03.03.2014
pawn Code:
mysql_function_query(dbhandle, query,false, #,#);
Re: MySql estб setando o e-mail mбs nгo estб chamando dialog -
[BOPE]Seu._.Madruga - 03.03.2014
Bom ainda nгo resolveu meu problema, abaixo irei colocar a print mostrando que estб setando no banco de dados o e-mail. Mбs nгo estб chamando o cуdigo que vem abaixo que no caso й a dialog Regras.
Email setado:
Depois que o e-mail й setado nгo aparece a funзгo que estб logo abaixo que й a dialog Regras:
Aonde a funзгo estб parando: Dialog email
PHP Code:
if( dialogid == DIALOG_EMAIL )
{
if( response )
{
new aname [ MAX_PLAYER_NAME ], string1 [ 450 ], file [ 148 ];
GetPlayerName( playerid,aname, sizeof( aname ) ) ;
//format( file, sizeof( file ) ,"Contas/%s.ini", aname ) ;
if( !strlen( inputtext ) )
{
SendClientMessage( playerid,-1, " [ x ] {FF0000}Digite um e-mail para no futuro caso precise recupere sua conta." ) ;
format( string1, sizeof( string1 ) ,"{FFFFFF}» {FF0000}COLOQUE ABAIXO SEU E-MAIL PARA RECUPERACAO DE SENHA!\n{FFFFFF}» {FF0000}COLOQUE UM E-MAIL VБLIDO!\n{FFFFFF}» {FF0000}NГO SEREMOS RESPONSAVEIS A RECUPERAR CONTAS SEM E-MAIL!\n\n{FFFFFF}Insira um e-mail vбlido para recuperaзгo de senha:", aname ) ;
ShowPlayerDialog( playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "{FFFFFF}•» {FFFF00}B{00FF00}r{3366FF}a{FFFF00}s{00FF00}i{3366FF}l {FFFFFF}PlayBoy City RPG {FF0000}№.°™", string1, "Salvar", "Cancelar" ) ;
}
else
{
//dini_Set( file, "Email",inputtext ) ;
new query[1024];
format(query, sizeof(query), "UPDATE `usuarios` SET `email` = '%s' WHERE `usuario` = '%s'", inputtext, aname);
mysql_function_query(dbhandle, query, false, "", "");
SendClientMessage( playerid,-1, "•{FFE583}» Email cadastrado em sua conta, analise nossas regras para evitar puniзхes." ) ;
new string2 [ 1500 ];
new line1 [ 255 ],line2 [ 255 ],line3 [ 255 ],line4 [ 255 ],line5 [ 370 ],line6 [ 255 ],line7 [ 255 ];
format( line1, sizeof( line1 ) ,"blablabla\n blablabla" ) ;
format( line2, sizeof( line2 ) ,"blablabla\n blablabla" ) ;
format( line3, sizeof( line3 ) ,"blablabla\n blablabla" ) ;
format( line4, sizeof( line4 ) ,"blablabla\n blablabla" ) ;
format( line5, sizeof( line5 ) ,"blablabla\n blablabla" ) ;
format( line6, sizeof( line6 ) ,"blablabla\n blablabla" ) ;
format( line7, sizeof( line7 ) ,"blablabla\n blablabla" ) ;
format( string2, sizeof( string2 ) ," {5FFF00} [ Regras Gerais - PlayBoy City RPG №.°™ ]\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s", line1, line2, line3, line4, line5, line6, line7 ) ;
ShowPlayerDialog( playerid, DIALOG_REGRAS, DIALOG_STYLE_MSGBOX, "{FFFFFF}•» {FFFF00}B{00FF00}r{3366FF}a{FFFF00}s{00FF00}i{3366FF}l {FFFFFF}PlayBoy City RPG {FF0000}№.°™", string2, "ACEITAR", "RECUSAR" ) ;
}
}
else
{
new stringz [ 148 ];
format( stringz, sizeof( stringz ) ," [ x ] O( a ) player %s foi kickado( a ) por nгo efetuar um registro." ) ;
SendClientMessageToAll( -1, stringz ) ;
Kick( playerid ) ;
}
}
Meu mysql.log:
PHP Code:
[16:57:11] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true
[16:57:11] [DEBUG] CMySQLHandle::Create - creating new connection..
[16:57:11] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[16:57:11] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
[16:57:11] [DEBUG] CMySQLConnection::Connect - connection was successful
[16:57:11] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[16:57:11] [DEBUG] CMySQLConnection::Connect - connection was successful
[16:57:11] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[16:57:11] [DEBUG] mysql_tquery - connection: 1, query: "CREATE TABLE IF NOT EXISTS usuarios(id MEDIUMINT PRIMARY KEY NOT", callback: "(null)", format: "(null)"
[16:57:11] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[16:57:11] [DEBUG] mysql_tquery - scheduling query "CREATE TABLE IF NOT EXISTS usuarios(id MEDIUMINT PRIMARY KEY NOT NULL AUTO_INCREMENT, usuario VARCHAR( 24 ), senha VARCHAR( 40 ), email VARCHAR( 60 ), level INT( 20 ), dinheiro INT( 20 ), morreu INT( 20 ), matou INT( 20 ), minuto1 INT( 20 ), minuto2 INT( 20 ), segundo1 INT( 20 ), segundo2 INT( 20 ), experiencia INT( 20 ) )"..
[16:57:11] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[16:57:11] [DEBUG] CMySQLQuery::Execute[()] - query was successful
[16:57:11] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
[16:57:11] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[16:57:11] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[16:57:45] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `usuarios` WHERE `usuario` = 'Malakas_.'", callback: "q_loginRequest", format: "d"
[16:57:45] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[16:57:45] [DEBUG] mysql_tquery - scheduling query "SELECT * FROM `usuarios` WHERE `usuario` = 'Malakas_.'"..
[16:57:45] [DEBUG] CMySQLQuery::Execute[q_loginRequest(d)] - starting query execution
[16:57:45] [DEBUG] CMySQLQuery::Execute[q_loginRequest(d)] - query was successful
[16:57:45] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[16:57:45] [DEBUG] CMySQLQuery::Execute[q_loginRequest(d)] - data being passed to ProcessCallbacks()
[16:57:45] [DEBUG] Calling callback "q_loginRequest"..
[16:57:45] [DEBUG] cache_get_data - connection: 1
[16:57:45] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[16:57:45] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[16:57:52] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `usuarios` (usuario, senha, morreu, matou, dinheiro,", callback: "(null)", format: "(null)"
[16:57:52] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[16:57:52] [DEBUG] mysql_tquery - scheduling query "INSERT INTO `usuarios` (usuario, senha, morreu, matou, dinheiro, minuto1, minuto2, segundo1, segundo2, experiencia) VALUES ('Malakas_.', 'leonardobradoks', '0', '0', '5000', '0', '9', '5', '9', '0')"..
[16:57:52] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[16:57:52] [DEBUG] CMySQLQuery::Execute[()] - query was successful
[16:57:52] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
[16:57:52] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[16:57:52] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[16:58:01] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `usuarios` SET `email` = 'meuemail2014@hotmail.com' WHERE", callback: "(null)", format: "(null)"
[16:58:01] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[16:58:01] [DEBUG] mysql_tquery - scheduling query "UPDATE `usuarios` SET `email` = 'meuemail2014@hotmail.com' WHERE `usuario` = 'Malakas_.'"..
[16:58:01] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[16:58:01] [DEBUG] CMySQLQuery::Execute[()] - query was successful
[16:58:01] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
[16:58:01] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[16:58:01] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called