14.05.2015, 10:23
Hi everyone , i'am now creating register/login system and i got a problem with registration , so when i'am logged in with account that i have created ( for example Account ID 17 ) , then i disconnect and reconnect with new account that i will create it In game , i got the same 'CompteID' and when my account save , the stats of my new account will be in the old account, check my PlayerFile_Create
Save :
Thank's for reading.
PHP код:
forward PlayerFile_Create(playerid);
public PlayerFile_Create(playerid)
{
APlayerData[playerid][CompteID] = cache_insert_id();
printf("ETAT DU SERVEUR: ENREGISTREMENT D'UN COMPTE ID : %d", APlayerData[playerid][CompteID]);
return 1;
}
PHP код:
forward PlayerFile_Save(playerid);
public PlayerFile_Save(playerid)
{
new query[1024];
format(query, sizeof(query), "UPDATE `users` SET `Level` = %d,", APlayerData[playerid][PlayerLevel]);
format(query, sizeof(query), "%s `VIP` = %d, `Jailed` = %d, `Wanted` = %d,", query, APlayerData[playerid][VIPLevel], APlayerData[playerid][PlayerJailed], GetPlayerWantedLevel(playerid));
format(query, sizeof(query), "%s `Bans` = %d, `BanTime` = %d, `TruckerLicense` = %d,", query, APlayerData[playerid][Bans], APlayerData[playerid][BanTime], APlayerData[playerid][TruckerLicense]);
format(query, sizeof(query), "%s `BusLicense` = %d, `PilotLicense` = %d,", query, APlayerData[playerid][BusLicense], APlayerData[playerid][PilotLicense]);
format(query, sizeof(query), "%s `MafiaLicense` = %d, `Muted` = %d,", query, APlayerData[playerid][MafiaLicense], APlayerData[playerid][Muted]);
format(query, sizeof(query), "%s `RulesRead` = %d, `StatsMetersDriven` = %d, `LastLoggin` = %d,", query, APlayerData[playerid][RulesRead], APlayerData[playerid][StatsMetersDriven], ReturnDate());
format(query, sizeof(query), "%s `StatsTruckerJobs` = %d, `StatsConvoyJobs` = %d,", query, APlayerData[playerid][StatsTruckerJobs], APlayerData[playerid][StatsConvoyJobs]);
format(query, sizeof(query), "%s `StatsBusDriverJobs` = %d, `StatsPilotJobs` = %d,", query, APlayerData[playerid][StatsBusDriverJobs], APlayerData[playerid][StatsPilotJobs]);
format(query, sizeof(query), "%s `StatsMafiaJobs` = %d, `StatsMafiaStolen` = %d,", query, APlayerData[playerid][StatsMafiaJobs], APlayerData[playerid][StatsMafiaStolen]);
format(query, sizeof(query), "%s `StatsPoliceFined` = %d, `StatsPoliceJailed` = %d,", query, APlayerData[playerid][StatsPoliceFined], APlayerData[playerid][StatsPoliceJailed]);
format(query, sizeof(query), "%s `StatsCourierJobs` = %d, `StatsRoadworkerJobs` = %d,", query, APlayerData[playerid][StatsCourierJobs], APlayerData[playerid][StatsRoadworkerJobs]);
format(query, sizeof(query), "%s `StatsAssistance` = %d, `Team` = %d, `Leader` = %d,", query, APlayerData[playerid][StatsAssistance], APlayerData[playerid][Team], APlayerData[playerid][Leader]);
format(query, sizeof(query), "%s `Heuresjouer` = %d, `Minutesjouer` = %d,", query, APlayerData[playerid][pHeures], APlayerData[playerid][pMinutes]);
format(query, sizeof(query), "%s `Money` = %d, `Score` = %d WHERE `ID` = %d", query, APlayerData[playerid][PlayerMoney], APlayerData[playerid][PlayerScore], APlayerData[playerid][CompteID]);
mysql_format(g_iHandle, query, sizeof(query), "%s", query);
mysql_tquery(g_iHandle, query);
printf("STATS DU SERVEUR | ENREGISTREMENT MYSQL : %s", query);
return 1;
}