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");
}
}
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
}
}
[06:02:40] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [06:02:40] [DEBUG] CMySQLHandle::Create - creating new connection.. [06:02:40] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [06:02:40] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:02:40] [DEBUG] mysql_errno - connection: 1 [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:03:54] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1" [06:03:54] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = 'Malcom Saka", callback: "VerificationCompte", format: "i" [06:03:54] [DEBUG] CMySQLQuery::Execute[VerificationCompte] - starting query execution [06:03:54] [DEBUG] CMySQLQuery::Execute[VerificationCompte] - query was successfully executed within 0.842 milliseconds [06:03:54] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [06:03:54] [DEBUG] Calling callback "VerificationCompte".. [06:03:54] [DEBUG] cache_get_data - connection: 1 [06:03:54] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [06:04:03] [DEBUG] mysql_format - connection: 1, len: 250, format: "INSERT INTO `comptes` (`pseudo`, `pass`) VALUES ('%e', '%e')" [06:04:03] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `comptes` (`pseudo`, `pass`) VALUES ('Malcom Sakafay", callback: "CreationCompte", format: "i" [06:04:03] [DEBUG] CMySQLQuery::Execute[CreationCompte] - starting query execution [06:04:03] [DEBUG] CMySQLQuery::Execute[CreationCompte] - query was successfully executed within 1.501 milliseconds [06:04:03] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [06:04:03] [DEBUG] Calling callback "CreationCompte".. [06:04:03] [DEBUG] cache_insert_id - connection: 1 [06:04:03] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [06:04:09] [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,`ran..." [06:04:09] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `comptes` SET `admin` = 0,`sexe` = 1,`age` = 25,`register", callback: "(null)", format: "(null)" [06:04:09] [DEBUG] CMySQLQuery::Execute[] - starting query execution [06:04:09] [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 '`ID` = 9' at line 1 [06:04:09] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
public OnPlayerConnect(playerid){
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);
return 1;
}
function 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
{
new requete[100];
mysql_format(mysql, requete, sizeof(requete), "SELECT * FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1", RPName(playerid)); // On prend la ligne ou le nom est йgal au nom du joueur
mysql_tquery(mysql, requete, "ChargerCompte", "i", playerid);
cache_get_field_content(0, "pass", pinfo[playerid][Pass], mysql, 66); // Transfиre le contenu de MDP de notre BDD et l'assigne а iJoueur[playerid][MDP]
pinfo[playerid][ID] = cache_get_field_content_int(0, "ID"); // Transfиre le contenu de ID de notre BDD et l'assigne а iJoueur[playerid][ID]
if(pinfo[playerid][Register] == 1){
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 if(pinfo[playerid][Register] == 0){
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
}
}
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
}
}
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);
mysql_tquery(mysql, query, "CreationCompte", "i", playerid);
}
}
}
function CreationCompte(playerid)
{
new tmp[185],query[100];
pinfo[playerid][ID] = cache_insert_id(); // On prend l'ID de compte du joueur et on l'insиre dans iJoueur[playerid][ID]
/*mysql_format(mysql, query, sizeof(query), "UPDATE `comptes` SET 'argent'=%d WHERE `ID`=%d",iJoueur[playerid][Argent],iJoueur[playerid][ID]);
mysql_tquery(mysql, query, "", "");
GivePlayerMoney(playerid,12345);*/
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);
printf("[Inscription] Nouveau compte inscri. ID de compte: [%d]", pinfo[playerid][ID]);
return 1;
}
if(playertextid == TDSexe[playerid][2])
{
/*if(!response) return Kick(playerid);
if(response){*/
// switch(listitem){
// case 0: pinfo[playerid][Sexe] = 1, SCM(playerid, JAUNE,"> "blanc"Tu es un "bleuc"homme");
// case 1: pinfo[playerid][Sexe] = 2, SCM(playerid, JAUNE,"> "blanc"Tu es une "bleuc"femme");
// }
pinfo[playerid][Sexe] = 1;
SCM(playerid, JAUNE,"> "blanc"Tu es un "bleuc"homme");
pinfo[playerid][Register] = 0;
//SetSpawnInfo(playerid, 0, 0, POS_SPAWN, 18.8019, 0, 0, 0, 0, 0, 0);
// SpawnPlayer(playerid);
// TogglePlayerSpectating(playerid, 0);
//TimerFirstSpawn[playerid] = SetTimerEx("FirstSpawn", SECONDS(2), false, "i", playerid);
//MessagePlayerConnect(playerid);
//SCM(playerid, JAUNE,"> "blanc"Inscription en cours..");
// PlayerTextDrawShow(playerid, TextBand3[playerid]);
// PlayerTextDrawShow(playerid, TextChargement[playerid]);
PlayerTextDrawHide(playerid, TDSexe[playerid][0]);
PlayerTextDrawHide(playerid, TDSexe[playerid][1]);
PlayerTextDrawHide(playerid, TDSexe[playerid][2]);
PlayerTextDrawHide(playerid, TDSexe[playerid][3]);
CancelSelectTextDraw(playerid);
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, ""NOM_SERVEUR" - Enregistrement", "Quel est votre age ? (Entre 10 et 90 ans)", "Ok", "Quitter");
}
if(playertextid == TDSexe[playerid][3])
{
/*if(!response) return Kick(playerid);
if(response){*/
// switch(listitem){
// case 0: pinfo[playerid][Sexe] = 1, SCM(playerid, JAUNE,"> "blanc"Tu es un "bleuc"homme");
// case 1: pinfo[playerid][Sexe] = 2, SCM(playerid, JAUNE,"> "blanc"Tu es une "bleuc"femme");
// }
pinfo[playerid][Sexe] = 2;
SCM(playerid, JAUNE,"> "blanc"Tu es une "rose"femme");
pinfo[playerid][Register] = 0;
// SetSpawnInfo(playerid, 0, 0, POS_SPAWN, 18.8019, 0, 0, 0, 0, 0, 0);
// SpawnPlayer(playerid);
// TogglePlayerSpectating(playerid, 0);
// TimerFirstSpawn[playerid] = SetTimerEx("FirstSpawn", SECONDS(2), false, "i", playerid);
// MessagePlayerConnect(playerid);
// SCM(playerid, JAUNE,"> "blanc"Inscription en cours..");
// PlayerTextDrawShow(playerid, TextBand3[playerid]);
// PlayerTextDrawShow(playerid, TextChargement[playerid]);
PlayerTextDrawHide(playerid, TDSexe[playerid][0]);
PlayerTextDrawHide(playerid, TDSexe[playerid][1]);
PlayerTextDrawHide(playerid, TDSexe[playerid][2]);
PlayerTextDrawHide(playerid, TDSexe[playerid][3]);
CancelSelectTextDraw(playerid);
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, ""NOM_SERVEUR" - Enregistrement", "Quel est votre age ? (Entre 10 et 90 ans)", "Ok", "Quitter");
}
case DIALOG_AGE:{
if (!response) return Kick(playerid);
if(response){
new string[194];
pinfo[playerid][Age] = strval(inputtext);
if(pinfo[playerid][Age] < 10 || pinfo[playerid][Age] > 90){
SendClientMessage(playerid, ROUGE, ">"blanc" Vous n'avez pas fait comme il faut.");
pinfo[playerid][Register] = 0;
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, ""NOM_SERVEUR" - Enregistrement", "Quel est votre age ? (Entre 10 et 90 ans)", "Ok", "Quitter");
return 1;
}
SetSpawnInfo(playerid, 0, 0, 5.2094, 1746.1613, 382.9088, 356.6506, 0, 0, 0, 0, 0, 0);
KillTimer(ttimer[playerid]);
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, 0);
TimerFirstSpawn[playerid] = SetTimerEx("FirstSpawn", SECONDS(2), false, "i", playerid);
SCM(playerid, JAUNE,"> "blanc"Chargement de votre compte en cours..");
PlayerTextDrawShow(playerid, TextBand3[playerid]);
PlayerTextDrawShow(playerid, TextChargement[playerid]);
format(string,sizeof(string),">"blanc" Tu as "bleuc"%d"blanc" ans.",pinfo[playerid][Age]);
SendClientMessage(playerid, JAUNE, string);
pinfo[playerid][Register] = 0;
}
}
function FirstSpawn(playerid){
TimerPayDay[playerid] = SetTimerEx("PayeDay", MINUTES(1), true, "i", playerid);
StopAudioStreamForPlayer(playerid);
PlayerConnecter[playerid] = true;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//Sexe
if(pinfo[playerid][Sexe] == 1){
SetPlayerSkin(playerid, 26);
pinfo[playerid][Skin] = 26;
}
if(pinfo[playerid][Sexe] == 2){
SetPlayerSkin(playerid, 226);
pinfo[playerid][Skin] = 226;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//Register
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
// format(ip, sizeof(ip), "%s",RPIP(playerid));
pinfo[playerid][Level] = 1;
SetPlayerScore(playerid, 1);
pinfo[playerid][MaxExp] = 2;
// format(pinfo[playerid][IP], 16, "%s", RPIP(playerid));
// GetPlayerIp(playerid, pinfo[playerid][IP], 16);
// pinfo[playerid][IP] = ip;
strmid(pinfo[playerid][IP],ip,0,strlen(ip),16);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//Money
ResetPlayerMoney(playerid);
pinfo[playerid][Argent] = 500;
GivePlayerMoney(playerid, 500);
pinfo[playerid][Banque] = 2000;
pinfo[playerid][Bancaire] = 0;
pinfo[playerid][BancaireSec] = 0;
pinfo[playerid][Hacker] = 0;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//vie & armure
// pinfo[playerid][Vie] = 100;
SetHealth(playerid, 50);
pGilet[playerid] = true, SetArmour(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
//AUTRES
pinfo[playerid][JobPv] = 0;
pinfo[playerid][Gang] = 0;
pinfo[playerid][Mafia] = 0;
pinfo[playerid][Permisc] = 0;
pinfo[playerid][Permisv] = 0;
pinfo[playerid][Admin] = 0;
pinfo[playerid][Rank] = 0;
pinfo[playerid][Job] = 0;
pinfo[playerid][RankJob] = 0;
pinfo[playerid][Faction] = 0;
pinfo[playerid][Id] = 0;
pinfo[playerid][Permisa] = 0;
pinfo[playerid][Spawn] = 1;
pinfo[playerid][Vip] = 0;
pinfo[playerid][VipLvl] = 0;
pinfo[playerid][Coif] = 0;
pinfo[playerid][Tuto] = 0;
pinfo[playerid][Astuces] = 0;
pinfo[playerid][Jerrican] = 0;
pinfo[playerid][LitreJerrican] = 0;
pinfo[playerid][Radio] = 0;
pinfo[playerid][FreqRadio] = 0;
pinfo[playerid][pindex0] = 999;
pinfo[playerid][pindex1] = 999;
pinfo[playerid][pindex2] = 999;
pinfo[playerid][pindex3] = 999;
pinfo[playerid][pindex4] = 999;
pinfo[playerid][pindex5] = 999;
pinfo[playerid][Force] = 1;
pinfo[playerid][ForceTime] = 0;
pinfo[playerid][DrogueForce] = 0;
pinfo[playerid][DrogueForceTime] = 0;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//save player data
SavePlayerData(playerid);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//hide textdraw
PlayerTextDrawHide(playerid, TextBand1[playerid]);
PlayerTextDrawHide(playerid, TextBand2[playerid]);
PlayerTextDrawHide(playerid, TextBand3[playerid]);
PlayerTextDrawHide(playerid, TextChargement[playerid]);
SCM(playerid, JAUNE,"> "blanc"Chargement terminй.");
SetPlayerCameraPos(playerid, 1028.9520, -2521.8523, 89.6991);
SetPlayerCameraLookAt(playerid, 1034.5470, -2603.4155, 86.0293);
IntroObject[playerid] = CreatePlayerObject(playerid, 14553, 968.38983, -2594.38330, 86.02931, 12.00000, 0.00000, 84.00000);
MovePlayerObject(playerid, IntroObject[playerid], 1135.6824, -2618.8701, 86.0293, 15.0, 12.0000, 0.0000, 84.0000);
SetTimerEx("QTUTO1", 10000, false, "i", playerid);
pinfo[playerid][Register] = 0;
return 1;
}
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, "", "");
new requete2[2500];
mysql_format(mysql, requete2, sizeof(requete2), "UPDATE `comptes` SET `timeduty` = %d,\
`timedutyjob` = %d,\
`timedutyjobpv` = %d,\
`coke` = %d,\
`cokec` = %d,\
`morphine` = %d,\
`morphinec` = %d,\
`weed` = %d,\
`weedc` = %d,\
`shit` = %d,\
`shitc` = %d,\
`graineweed` = %d,\
`graineweedc` = %d,\
`dependance` = %d,\
`dependancetype` = %d,\
`dependancetime` = %d,\
`job` = %d,\
`exp` = %d,\
`maxexp` = %d,\
`forces` = %d,\
`forcetime` = %d,\
`drogueforce` = %d,\
`drogueforcetime` = %d,\
`dette` = %d,\
`permisv` = %d,\
`permisc` = %d,\
`permisa` = %d,\
`timerweed = %d,\
`gps` = %d,\
`c4` = %d,\
`jerrican` = %d,\
`litrejerrican` = %d,\
`radio` = %d,\
`freqradio` = %d,\
`boombox` = %d,\
`averto` = %d,\
`matos` = %d,\
`vproprio1` = %d,\
`vproprio2` = %d,\
`vproprio3` = %d,\
`locationveh` = %d,\
`vloc` = %d,\
`vproprio4` = %d,\
`vproprio5` = %d,\
`vpreter` = %d,\
`vip` = %d,\
`viplvl` = %d,\
WHERE `ID` = %d",
pinfo[playerid][TimeDuty],
pinfo[playerid][TimeDutyJob],
pinfo[playerid][TimeDutyJobPv],
pinfo[playerid][Coke],
pinfo[playerid][Cokec],
pinfo[playerid][Morphine],
pinfo[playerid][Morphinec],
pinfo[playerid][Weed],
pinfo[playerid][Weedc],
pinfo[playerid][Shit],
pinfo[playerid][Shitc],
pinfo[playerid][GraineWeed],
pinfo[playerid][GraineWeedc],
pinfo[playerid][Dependance],
pinfo[playerid][DependanceType],
pinfo[playerid][DependanceTime],
pinfo[playerid][Job],
pinfo[playerid][Exp],
pinfo[playerid][MaxExp],
pinfo[playerid][Force],
pinfo[playerid][ForceTime],
pinfo[playerid][DrogueForce],
pinfo[playerid][DrogueForceTime],
pinfo[playerid][Dette],
pinfo[playerid][Permisv],
pinfo[playerid][Permisc],
pinfo[playerid][Permisa],
pinfo[playerid][TimerWeed],
pinfo[playerid][Gps],
pinfo[playerid][C4],
pinfo[playerid][Jerrican],
pinfo[playerid][LitreJerrican],
pinfo[playerid][Radio],
pinfo[playerid][FreqRadio],
pinfo[playerid][Boombox],
pinfo[playerid][Averto],
pinfo[playerid][Matos],
pinfo[playerid][vProprio1],
pinfo[playerid][vProprio2],
pinfo[playerid][vProprio3],
pinfo[playerid][LocationVeh],
pinfo[playerid][vLoc],
pinfo[playerid][vProprio4],
pinfo[playerid][vProprio5],
pinfo[playerid][vPreter],
pinfo[playerid][Vip],
pinfo[playerid][VipLvl],
pinfo[playerid][ID]);
mysql_tquery(mysql, requete2, "", "");
new requete3[2500];
mysql_format(mysql, requete3, sizeof(requete3), "UPDATE `comptes` SET `arme1` = %d,\
`arme2` = %d,\
`arme3` = %d,\
`arme4` = %d,\
`arme5` = %d,\
`arme6` = %d,\
`arme7` = %d,\
`arme8` = %d,\
`arme9` = %d,\
`ammo1` = %d,\
`ammo2` = %d,\
`ammo3` = %d,\
`ammo4` = %d,\
`ammo5` = %d,\
`ammo6` = %d,\
`ammo7` = %d,\
`ammo8` = %d,\
`ammo9` = %d,\
`pos_x` = %f,\
`pos_y` = %f,\
`pos_z` = %f,\
`vie` = %f,\
`armure` = %f,\
`corde` = %d,\
`casque` = %d,\
`tel` = %d,\
`eobj` = %d,\
`c_name1` = '%e',\
`c_name2` = '%e',\
`c_name3` = '%e',\
`c_name4` = '%e',\
`c_name5` = '%e',\
`c_name6` = '%e',\
`c_name7` = '%e',\
`c_name8` = '%e',\
`c_name9` = '%e',\
`c_name10` = '%e',\
WHERE `ID` = %d",
pinfo[playerid][Arme1],
pinfo[playerid][Arme2],
pinfo[playerid][Arme3],
pinfo[playerid][Arme4],
pinfo[playerid][Arme5],
pinfo[playerid][Arme6],
pinfo[playerid][Arme7],
pinfo[playerid][Arme8],
pinfo[playerid][Arme9],
pinfo[playerid][Ammo1],
pinfo[playerid][Ammo2],
pinfo[playerid][Ammo3],
pinfo[playerid][Ammo4],
pinfo[playerid][Ammo5],
pinfo[playerid][Ammo6],
pinfo[playerid][Ammo7],
pinfo[playerid][Ammo8],
pinfo[playerid][Ammo9],
pinfo[playerid][Pos_X],
pinfo[playerid][Pos_Y],
pinfo[playerid][Pos_Z],
pinfo[playerid][Vie],
pinfo[playerid][Armure],
pinfo[playerid][Corde],
pinfo[playerid][Casque],
pinfo[playerid][Tel],
pinfo[playerid][eObj],
pinfo[playerid][c_Name1],
pinfo[playerid][c_Name2],
pinfo[playerid][c_Name3],
pinfo[playerid][c_Name4],
pinfo[playerid][c_Name5],
pinfo[playerid][c_Name6],
pinfo[playerid][c_Name7],
pinfo[playerid][c_Name8],
pinfo[playerid][c_Name9],
pinfo[playerid][c_Name10],
pinfo[playerid][ID]);
mysql_tquery(mysql, requete3, "", "");
new requete4[2500];
mysql_format(mysql, requete4, sizeof(requete4), "UPDATE `comptes` SET `c_name11` = '%e',\
`c_name12` = '%e',\
`c_name13` = '%e',\
`c_name14` = '%e',\
`c_name15` = '%e',\
`c_name16` = '%e',\
`c_name17` = '%e',\
`c_name18` = '%e',\
`c_name19` = '%e',\
`c_name20` = '%e',\
`c_num1` = %d,\
`c_num2` = %d,\
`c_num3` = %d,\
`c_num4` = %d,\
`c_num5` = %d,\
`c_num6` = %d,\
`c_num7` = %d,\
`c_num8` = %d,\
`c_num9` = %d,\
`c_num10` = %d,\
`c_num11` = %d,\
`c_num12` = %d,\
`c_num13` = %d,\
`c_num14` = %d,\
`c_num15` = %d,\
`c_num16` = %d,\
`c_num17` = %d,\
`c_num18` = %d,\
`c_num19` = %d,\
`c_num20` = %d,\
`pindex0` = %d,\
`pindex1` = %d,\
`pindex2` = %d,\
`pindex3` = %d,\
`pindex4` = %d,\
`pindex5` = %d,\
`pmodelid0` = %d,\
WHERE `ID` = %d",
pinfo[playerid][c_Name11],
pinfo[playerid][c_Name12],
pinfo[playerid][c_Name13],
pinfo[playerid][c_Name14],
pinfo[playerid][c_Name15],
pinfo[playerid][c_Name16],
pinfo[playerid][c_Name17],
pinfo[playerid][c_Name18],
pinfo[playerid][c_Name19],
pinfo[playerid][c_Name20],
pinfo[playerid][c_Num1],
pinfo[playerid][c_Num2],
pinfo[playerid][c_Num3],
pinfo[playerid][c_Num4],
pinfo[playerid][c_Num5],
pinfo[playerid][c_Num6],
pinfo[playerid][c_Num7],
pinfo[playerid][c_Num8],
pinfo[playerid][c_Num9],
pinfo[playerid][c_Num10],
pinfo[playerid][c_Num11],
pinfo[playerid][c_Num12],
pinfo[playerid][c_Num13],
pinfo[playerid][c_Num14],
pinfo[playerid][c_Num15],
pinfo[playerid][c_Num16],
pinfo[playerid][c_Num17],
pinfo[playerid][c_Num18],
pinfo[playerid][c_Num19],
pinfo[playerid][c_Num20],
pinfo[playerid][pindex0],
pinfo[playerid][pindex1],
pinfo[playerid][pindex2],
pinfo[playerid][pindex3],
pinfo[playerid][pindex4],
pinfo[playerid][pindex5],
pinfo[playerid][pmodelid0],
pinfo[playerid][ID]);
mysql_tquery(mysql, requete4, "", "");
new requete5[2500];
mysql_format(mysql, requete5, sizeof(requete5), "UPDATE `comptes` SET `pmodelid1` = %d,\
`pmodelid2` = %d,\
`pmodelid3` = %d,\
`pmodelid4` = %d,\
`pmodelid5` = %d,\
`pboneid0` = %d,\
`pboneid1` = %d,\
`pboneid2` = %d,\
`pboneid3` = %d,\
`pboneid4` = %d,\
`pboneid5` = %d,\
`pfoffsetx0` = %f,\
`pfoffsetx1` = %f,\
`pfoffsetx2` = %f,\
`pfoffsetx3` = %f,\
`pfoffsetx4` = %f,\
`pfoffsetx5` = %f,\
`pfoffsety0` = %f,\
`pfoffsety1` = %f,\
`pfoffsety2` = %f,\
`pfoffsety3` = %f,\
`pfoffsety4` = %f,\
`pfoffsety5` = %f,\
`pfoffsetz0` = %f,\
`pfoffsetz1` = %f,\
`pfoffsetz2` = %f,\
`pfoffsetz3` = %f,\
`pfoffsetz4` = %f,\
`pfoffsetz5` = %f,\
`pfrotx0` = %f,\
`pfrotx1` = %f,\
`pfrotx2` = %f,\
`pfrotx3` = %f,\
`pfrotx4` = %f,\
`pfrotx5` = %f,\
`pfroty0` = %f,\
`pfroty1` = %f,\
WHERE `ID` = %d",
pinfo[playerid][pmodelid1],
pinfo[playerid][pmodelid2],
pinfo[playerid][pmodelid3],
pinfo[playerid][pmodelid4],
pinfo[playerid][pmodelid5],
pinfo[playerid][pboneid0],
pinfo[playerid][pboneid1],
pinfo[playerid][pboneid2],
pinfo[playerid][pboneid3],
pinfo[playerid][pboneid4],
pinfo[playerid][pboneid5],
pinfo[playerid][pfOffsetX0],
pinfo[playerid][pfOffsetX1],
pinfo[playerid][pfOffsetX2],
pinfo[playerid][pfOffsetX3],
pinfo[playerid][pfOffsetX4],
pinfo[playerid][pfOffsetX5],
pinfo[playerid][pfOffsetY0],
pinfo[playerid][pfOffsetY1],
pinfo[playerid][pfOffsetY2],
pinfo[playerid][pfOffsetY3],
pinfo[playerid][pfOffsetY4],
pinfo[playerid][pfOffsetY5],
pinfo[playerid][pfOffsetZ0],
pinfo[playerid][pfOffsetZ1],
pinfo[playerid][pfOffsetZ2],
pinfo[playerid][pfOffsetZ3],
pinfo[playerid][pfOffsetZ4],
pinfo[playerid][pfOffsetZ5],
pinfo[playerid][pfRotX0],
pinfo[playerid][pfRotX1],
pinfo[playerid][pfRotX2],
pinfo[playerid][pfRotX3],
pinfo[playerid][pfRotX4],
pinfo[playerid][pfRotX5],
pinfo[playerid][pfRotY0],
pinfo[playerid][pfRotY1],
pinfo[playerid][ID]);
mysql_tquery(mysql, requete5, "", "");
new requete6[2500];
mysql_format(mysql, requete6, sizeof(requete6), "UPDATE `comptes` SET `pfroty2` = %f,\
`pfroty3` = %f,\
`pfroty4` = %f,\
`pfroty5` = %f,\
`pfrotz0` = %f,\
`pfrotz1` = %f,\
`pfrotz2` = %f,\
`pfrotz3` = %f,\
`pfrotz4` = %f,\
`pfrotz5` = %f,\
`pfscalex0` = %f,\
`pfscalex1` = %f,\
`pfscalex2` = %f,\
`pfscalex3` = %f,\
`pfscalex4` = %f,\
`pfscalex5` = %f,\
`pfscaley0` = %f,\
`pfscaley1` = %f,\
`pfscaley2` = %f,\
`pfscaley3` = %f,\
`pfscaley4` = %f,\
`pfscaley5` = %f,\
`pfscalez0` = %f,\
`pfscalez1` = %f,\
`pfscalez2` = %f,\
`pfscalez3` = %f,\
`pfscalez4` = %f,\
`pfscalez5` = %f\
WHERE `ID` = %d",
pinfo[playerid][pfRotY2],
pinfo[playerid][pfRotY3],
pinfo[playerid][pfRotY4],
pinfo[playerid][pfRotY5],
pinfo[playerid][pfRotZ0],
pinfo[playerid][pfRotZ1],
pinfo[playerid][pfRotZ2],
pinfo[playerid][pfRotZ3],
pinfo[playerid][pfRotZ4],
pinfo[playerid][pfRotZ5],
pinfo[playerid][pfScaleX0],
pinfo[playerid][pfScaleX1],
pinfo[playerid][pfScaleX2],
pinfo[playerid][pfScaleX3],
pinfo[playerid][pfScaleX4],
pinfo[playerid][pfScaleX5],
pinfo[playerid][pfScaleY0],
pinfo[playerid][pfScaleY1],
pinfo[playerid][pfScaleY2],
pinfo[playerid][pfScaleY3],
pinfo[playerid][pfScaleY4],
pinfo[playerid][pfScaleY5],
pinfo[playerid][pfScaleZ0],
pinfo[playerid][pfScaleZ1],
pinfo[playerid][pfScaleZ2],
pinfo[playerid][pfScaleZ3],
pinfo[playerid][pfScaleZ4],
pinfo[playerid][pfScaleZ5],
pinfo[playerid][ID]);
mysql_tquery(mysql, requete6, "", "");
return 1;
}
WHERE `ID` = %d",
WHERE `ID` = '%d'",
this
PHP код:
this PHP код:
|
Код HTML:
[06:02:40] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [06:02:40] [DEBUG] CMySQLHandle::Create - creating new connection.. [06:02:40] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [06:02:40] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:02:40] [DEBUG] mysql_errno - connection: 1 [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:02:40] [DEBUG] CMySQLConnection::Connect - connection was successful [06:02:40] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [06:03:54] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = '%e' LIMIT 1" [06:03:54] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `pass`, `ID` FROM `comptes` WHERE `pseudo` = 'Malcom Saka", callback: "VerificationCompte", format: "i" [06:03:54] [DEBUG] CMySQLQuery::Execute[VerificationCompte] - starting query execution [06:03:54] [DEBUG] CMySQLQuery::Execute[VerificationCompte] - query was successfully executed within 0.842 milliseconds [06:03:54] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [06:03:54] [DEBUG] Calling callback "VerificationCompte".. [06:03:54] [DEBUG] cache_get_data - connection: 1 [06:03:54] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [06:04:03] [DEBUG] mysql_format - connection: 1, len: 250, format: "INSERT INTO `comptes` (`pseudo`, `pass`) VALUES ('%e', '%e')" [06:04:03] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `comptes` (`pseudo`, `pass`) VALUES ('Malcom Sakafay", callback: "CreationCompte", format: "i" [06:04:03] [DEBUG] CMySQLQuery::Execute[CreationCompte] - starting query execution [06:04:03] [DEBUG] CMySQLQuery::Execute[CreationCompte] - query was successfully executed within 1.501 milliseconds [06:04:03] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [06:04:03] [DEBUG] Calling callback "CreationCompte".. [06:04:03] [DEBUG] cache_insert_id - connection: 1 [06:04:03] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [06:04:09] [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,`ran..." [06:04:09] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `comptes` SET `admin` = 0,`sexe` = 1,`age` = 25,`register", callback: "(null)", format: "(null)" [06:04:09] [DEBUG] CMySQLQuery::Execute[] - starting query execution [06:04:09] [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 '`ID` = 9' at line 1 [06:04:09] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError PHP код:
PHP код:
|