04.08.2016, 02:48
hello, i have a problem
in mysql_log :
[04:24:07] [DEBUG] mysql_format - connection: 1, len: 2500, format: "UPDATE `comptes` SET `admin` = %d,`sexe` = %d,`age` = %d,`register` = %d,`tuto` = %d,`ip` = %e,`skin` = %d,`faction` = %d,`rank`..."
[04:24:07] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `comptes` SET `admin` = 0,`sexe` = 0,`age` = 0,`register`", callback: "(null)", format: "(null)"
[04:24:07] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[04:24:07] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.157.75,`skin` = 0,`faction` = 0,`rank` = 0,`jobpv` = 0,`rankjob` = 0,`inte` = 0' at line 1
[04:24:07] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
[04:26:52] [DEBUG] CMySQLConnection:isconnect - connection was closed
[04:26:52] [DEBUG] CMySQLHandle::~CMySQLHandle - deconstructor called
[04:30:27] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[04:30:27] [DEBUG] CMySQLHandle::Create - creating new connection..
[04:30:27] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[04:30:27] [DEBUG] CMySQLHandle::Create - connection created (id: 1)
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:27] [DEBUG] mysql_errno - connection: 1
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:53] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1"
[04:30:53] [DEBUG] cache_get_data - connection: 1
[04:30:53] [WARNING] cache_get_data - no active cache
[04:31:02] [DEBUG] mysql_format - connection: 1, len: 2500, format: "UPDATE `comptes` SET `admin` = %d,`sexe` = %d,`age` = %d,`register` = %d,`tuto` = %d,`ip` = %e,`skin` = %d,`faction` = %d,`rank`..."
[04:31:02] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `comptes` SET `admin` = 0,`sexe` = 0,`age` = 0,`register`", callback: "(null)", format: "(null)"
[04:31:02] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[04:31:02] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.157.75,`skin` = 0,`faction` = 0,`rank` = 0,`jobpv` = 0,`rankjob` = 0,`inte` = 0' at line 1
[04:31:02] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
[04:31:04] [DEBUG] mysql_format - connection: 1, len: 250, format: "INSERT INTO `comptes` (`pseudo`, `pass`) VALUES ('%e', '%e')"
[04:31:04] [DEBUG] cache_insert_id - connection: 1
[04:31:04] [WARNING] cache_insert_id - no active cache
in onplayerconnect
I see the dialogue register but not after textdraw and the account is not created, can you help me please ?
in mysql_log :
[04:24:07] [DEBUG] mysql_format - connection: 1, len: 2500, format: "UPDATE `comptes` SET `admin` = %d,`sexe` = %d,`age` = %d,`register` = %d,`tuto` = %d,`ip` = %e,`skin` = %d,`faction` = %d,`rank`..."
[04:24:07] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `comptes` SET `admin` = 0,`sexe` = 0,`age` = 0,`register`", callback: "(null)", format: "(null)"
[04:24:07] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[04:24:07] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.157.75,`skin` = 0,`faction` = 0,`rank` = 0,`jobpv` = 0,`rankjob` = 0,`inte` = 0' at line 1
[04:24:07] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
[04:26:52] [DEBUG] CMySQLConnection:isconnect - connection was closed
[04:26:52] [DEBUG] CMySQLHandle::~CMySQLHandle - deconstructor called
[04:30:27] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[04:30:27] [DEBUG] CMySQLHandle::Create - creating new connection..
[04:30:27] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[04:30:27] [DEBUG] CMySQLHandle::Create - connection created (id: 1)
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:27] [DEBUG] mysql_errno - connection: 1
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:27] [DEBUG] CMySQLConnection::Connect - connection was successful
[04:30:27] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[04:30:53] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1"
[04:30:53] [DEBUG] cache_get_data - connection: 1
[04:30:53] [WARNING] cache_get_data - no active cache
[04:31:02] [DEBUG] mysql_format - connection: 1, len: 2500, format: "UPDATE `comptes` SET `admin` = %d,`sexe` = %d,`age` = %d,`register` = %d,`tuto` = %d,`ip` = %e,`skin` = %d,`faction` = %d,`rank`..."
[04:31:02] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `comptes` SET `admin` = 0,`sexe` = 0,`age` = 0,`register`", callback: "(null)", format: "(null)"
[04:31:02] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[04:31:02] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.157.75,`skin` = 0,`faction` = 0,`rank` = 0,`jobpv` = 0,`rankjob` = 0,`inte` = 0' at line 1
[04:31:02] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
[04:31:04] [DEBUG] mysql_format - connection: 1, len: 250, format: "INSERT INTO `comptes` (`pseudo`, `pass`) VALUES ('%e', '%e')"
[04:31:04] [DEBUG] cache_insert_id - connection: 1
[04:31:04] [WARNING] cache_insert_id - no active cache
PHP код:
function SavePlayerData(playerid){
/*new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");*/
new Float:vie, Float:armure;
GetPlayerHealth(playerid, vie);
GetPlayerArmour(playerid, armure);
//INI_WriteInt(File,"Pass", pinfo[playerid][Pass]);
new requete[2500];
mysql_format(mysql, requete, sizeof(requete), "UPDATE `comptes` SET `admin` = %d,\
`sexe` = %d,\
`age` = %d,\
`register` = %d,\
`tuto` = %d,\
`ip` = %e,\
`skin` = %d,\
`faction` = %d,\
`rank` = %d,\
`jobpv` = %d,\
`rankjob` = %d,\
`inte` = %d,\
`vw` = %d,\
`argent` = %d,\
`banque` = %d,\
`bancaire` = %d,\
`bancairesec` = %d,\
`hacker` = %d,\
`astuces` = %d,\
`nbrveh` = %d,\
`spec` = %d,\
`bannis` = %d,\
`jail` = %d,\
`jailtime` = %d,\
`level` = %d,\
`mort` = %d,\
`crash` = %d,\
`menotte` = %d,\
`cagoule` = %d,\
`nbrmaison` = %d,\
`nbrmaisonloc` = %d,\
`nbrbat` = %d,\
`nbrbiz` = %d,\
`lastint` = %d,\
`numtel` = %d,\
`calling` = %d,\
`payday` = %d\
WHERE `ID` = %d",
pinfo[playerid][Admin],
pinfo[playerid][Sexe],
pinfo[playerid][Age],
pinfo[playerid][Register],
pinfo[playerid][Tuto],
pinfo[playerid][IP],
pinfo[playerid][Skin],
pinfo[playerid][Faction],
pinfo[playerid][Rank],
pinfo[playerid][JobPv],
pinfo[playerid][RankJob],
pinfo[playerid][Int],
pinfo[playerid][Vw],
pinfo[playerid][Argent],
pinfo[playerid][Banque],
pinfo[playerid][Bancaire],
pinfo[playerid][BancaireSec],
pinfo[playerid][Hacker],
pinfo[playerid][Astuces],
pinfo[playerid][Id],
pinfo[playerid][Spec],
pinfo[playerid][Bannis],
pinfo[playerid][Jail],
pinfo[playerid][JailTime],
pinfo[playerid][Level],
pinfo[playerid][Mort],
pinfo[playerid][Crash],
pinfo[playerid][Menotte],
pinfo[playerid][Cagoule],
pinfo[playerid][NbrMaison],
pinfo[playerid][NbrMaisonLoc],
pinfo[playerid][NbrBat],
pinfo[playerid][NbrBiz],
pinfo[playerid][LastInt],
pinfo[playerid][NumTel],
pinfo[playerid][Calling],
pinfo[playerid][PayDay],
pinfo[playerid][ID]);
mysql_tquery(mysql, requete, "", "");
return 1;
}
case DIALOG_REGISTER:{
if (!response) return Kick(playerid);
if(response){
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Enregistrement","> Tu as as entrй un mauvais mot de passe.\nTape un mot de passe pour te crйe un comtpe:","Enregistrer","Quitter");
/*new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Pass",SHA256_PassHash(inputtext));
INI_Close(File);*/
if(strlen(inputtext) < 5) // Si le MDP insйrй fais moins de 5 charactиres
{
SendClientMessage(playerid, ROUGE, ">"blanc" Votre mot de passe doit contenir au moins 5 charactиres"); // On lui envoye un message disant que le MDP doit contenir au moins 5 charactиres.
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""NOM_SERVEUR" - Enregistrement", "Tape un mot de passe pour te crйer un compte:", "Enregistrer", "Quitter");
}
else // Si le MDP insйrй contient au moins 5 charactиres
{
new requete[512], hashpass[64+1], query[250];
SHA256_PassHash(inputtext, "ADAWAD11AWD41ASDA2L222KDH", hashpass, sizeof(hashpass));
mysql_format(mysql, query, sizeof(query), "INSERT INTO `comptes` (`pseudo`, `pass`) VALUES ('%e', '%e')", RPName(playerid), hashpass);
pinfo[playerid][ID] = cache_insert_id();
//mysql_tquery(mysql, query, "CreationCompte", "i", playerid);
printf("[Inscription] Nouveau compte inscri. ID de compte: [%d]", pinfo[playerid][ID]);
SavePlayerData(playerid);
PlayerTextDrawShow(playerid, TDSexe[playerid][0]);
PlayerTextDrawShow(playerid, TDSexe[playerid][1]);
PlayerTextDrawShow(playerid, TDSexe[playerid][2]);
PlayerTextDrawShow(playerid, TDSexe[playerid][3]);
PlayerTextDrawHide(playerid, TDConnexion[playerid][0]);
PlayerTextDrawHide(playerid, TDConnexion[playerid][1]);
PlayerTextDrawHide(playerid, TDConnexion[playerid][2]);
PlayerTextDrawHide(playerid, TDConnexion[playerid][3]);
PlayerTextDrawHide(playerid, TDConnexion[playerid][4]);
SelectTextDraw(playerid, 0x00FF00FF);
}
//ShowPlayerDialog(playerid, DIALOG_SEXE, DIALOG_STYLE_LIST, "Sexe - De quelle sexe est-tu ?", "Homme\nFemme", "Choisir", "Quitter");
}
}
PHP код:
new requete[128];
mysql_format(mysql, requete, sizeof(requete), "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1", RPName(playerid));
mysql_tquery(mysql, requete, "VerificationCompte", "i", playerid);
VerificationCompte(playerid)
{
new lignes, champs;
cache_get_data(lignes, champs, mysql); // Assigne le nombre de lignes et champs trouver aprиs notre requete dans "OnPlayerConnect"
if(lignes) // Si la ligne qui correspond a notre requete existe
{
cache_get_field_content(0, "pass", iJoueur[playerid][MDP], mysql, 66); // Transfиre le contenu de MDP de notre BDD et l'assigne а iJoueur[playerid][MDP]
iJoueur[playerid][ID] = cache_get_field_content_int(0, "ID"); // Transfиre le contenu de ID de notre BDD et l'assigne а iJoueur[playerid][ID]
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Connection...", "Tapez votre mot de passe pour vous connecter", "Connecter", "Quitter"); // On lui montre le dialogue de connection.
}
else // Si elle n'existe pas
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Inscription...", "Tapez un mot de passe pour inscrire ce compte.", "S'inscrire", "Quitter"); // On lui montre le dialogue d'inscription
}
}