PARTNERI:
-UPOZORENJE-

Samo registrovani članovi mogu da vide/koriste forum u celini.
Prijavite se ili registrujte nalog na Balkan SA-MP forumu.


Autor Tema: [Rešeno] Reg/Log mysql bug  (Pročitano 501 puta)

0 članova i 1 gost pregledaju ovu temu.

Van mreže #bokenzi

Reg/Log mysql bug
« poslato: Jun 04, 2020, 11:00:39 pre podne »
Problem(error/warning): Kad se ja registrujem na server, fino mi se zapise u databazu lozinka, spol drzava itd... Dok se drugi igrac registruje na server a ja sam u tom trenu aktivan, sve podatke koje on unese (lozinka, drzava, spol, godine...) se upise u moju tablicu pod mojim podacima, dok se njemu sve postavi na 0. Kada se ja disconectujem, meni se vrate moji zapisani registrovani podaci, dok drugom igracu je i dalje sve na 0. Postavit cu vam cijeli log/reg sistem, errora u mysql log nema, ukoliko vam nesto zatreba jos da provjerite, napisite mi :)
Dio skripte:
Pawno Code: [Izaberi]

public OnGameModeInit() {
new MySQLOpt: option_id = mysql_init_options();
mysql_set_option(option_id, AUTO_RECONNECT, true);
Database = mysql_connect(mysql_host, mysql_user, mysql_pass, mysql_database, option_id);
if(Database == MYSQL_INVALID_HANDLE || mysql_errno(Database) != 0) {
print("Connecting to MySQL database failed");
SendRconCommand("exit");
return (false);
}
        return (true);
}

public OnGameModeExit() {
foreach(new i: Player) {
Corrupt_Check[i]++;
SavePlayer(i);
if(cache_is_valid(PlayerInfo[i][Player_Cache])) {
cache_delete(PlayerInfo[i][Player_Cache]);
PlayerInfo[i][Player_Cache] = MYSQL_INVALID_CACHE;
}
}
mysql_close(Database);
}

public OnPlayerConnect(playerid) {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CreatePlayerTextDraws(playerid);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new DB_Query[115];
GetPlayerName(playerid, PlayerInfo[playerid][Name], MAX_PLAYER_NAME);
Corrupt_Check[playerid]++;
mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `users` WHERE `username` = `%e` LIMIT 1", PlayerInfo[playerid][Name]);
mysql_tquery(Database, DB_Query, "OnPlayerDataCheck", "ii", playerid, Corrupt_Check[playerid]);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
return (true);
}

forward OnPlayerDataCheck(playerid, corrupt_check);
public OnPlayerDataCheck(playerid, corrupt_check) {
if (corrupt_check != Corrupt_Check[playerid]) return Kick(playerid);
new rows;
cache_get_row_count(rows);
if(rows > 0) {
new String[512];
cache_get_value(0, "Password", PlayerInfo[playerid][Password], 65);
PlayerInfo[playerid][Player_Cache] = cache_save();
InterpolateCameraPos(playerid, 1294.575073, -1863.813354, 18.763757, 1384.041992, -885.596618, 71.000038, 30000);
InterpolateCameraLookAt(playerid, 1294.750732, -1858.821411, 18.541175, 1385.695800, -880.888000, 71.305839, 30000);
ClearChat(playerid);
format(String, sizeof(String), ""server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"server_col"--> "white"Dobrodosao "server_col"%s "white"na "server_col"Worldwide Community\n\
  "server_col"--> "white"Vas racun je pronadjen u bazi podataka, molimo vas prijavite se\n\
  "server_col"--> "white"Imate 30 sekundi da se prijavite na server\n"server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", PlayerInfo[playerid][Name]);
spd(playerid, d_log, dsp, ""wwhp"Prijava na server", String, "Prijava", "Izlaz");
LogKick[playerid] = SetTimerEx("LogKickTimer", 30000, false, "i", playerid);
}
else {
TogglePlayerSpectating(playerid, true);
InterpolateCameraPos(playerid, 1294.575073, -1863.813354, 18.763757, 1384.041992, -885.596618, 71.000038, 30000);
InterpolateCameraLookAt(playerid, 1294.750732, -1858.821411, 18.541175, 1385.695800, -880.888000, 71.305839, 30000);
for(new i=0; i<13; i++) {
ptds(playerid, RegisterTD[playerid][i]);
SelectTextDraw(playerid, 0x1783E2FF);
}
ptdh(playerid, RegisterTD[playerid][7]);
OnRegister[playerid] = 1;
ClearChat(playerid);
}
return (true);
}

public OnPlayerDisconnect(playerid, reason) {
foreach(new i: Player) {
Corrupt_Check[i]++;
SavePlayer(i);
if(cache_is_valid(PlayerInfo[i][Player_Cache])) {
cache_delete(PlayerInfo[i][Player_Cache]);
PlayerInfo[i][Player_Cache] = MYSQL_INVALID_CACHE;
}
       }

}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
switch (dialogid) {
case d_log: {
if(!response) return Kick(playerid);
else {
new account_pass[65];
SHA256_PassHash(inputtext, GetName(playerid), account_pass, 65);
if(strcmp(account_pass, PlayerInfo[playerid][Password]) == 0) {
cache_set_active(PlayerInfo[playerid][Player_Cache]);
            cache_get_value_int(0, "ID", PlayerInfo[playerid][ID]);
        cache_get_value_int(0, "Kills", PlayerInfo[playerid][Kills]);
        cache_get_value_int(0, "Deaths", PlayerInfo[playerid][Deaths]);
        cache_get_value_int(0, "Score", PlayerInfo[playerid][Score]);
        cache_get_value_int(0, "Cash", PlayerInfo[playerid][Cash]);
        cache_get_value_int(0, "Admin", PlayerInfo[playerid][Admin]);
        cache_get_value_int(0, "Country", PlayerInfo[playerid][Country]);
        cache_get_value_int(0, "Age", PlayerInfo[playerid][Ages]);
        cache_get_value_int(0, "Sex", PlayerInfo[playerid][Sex]);
        cache_get_value_int(0, "AdminCode", PlayerInfo[playerid][AdminCode]);
        SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
cache_delete(PlayerInfo[playerid][Player_Cache]);
PlayerInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE;
LoggedIn[playerid] = 1;
CreatePlayer(playerid);
KillTimer(LogKick[playerid]);
}
else {
    new String[512];
PlayerInfo[playerid][PasswordFails] += 1;
if (PlayerInfo[playerid][PasswordFails] >= 3) {
Kick(playerid);
}
else {
format(String, sizeof(String), ""error"Pogresna lozinka, imate jos %d od 3 pokusaja", PlayerInfo[playerid][PasswordFails]);
scm(playerid, -1, String);
              format(String, sizeof(String), ""server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"server_col"--> "white"Dobrodosao "server_col"%s "white"na "server_col"Worldwide Community\n\
              "server_col"--> "white"Vas racun je pronadjen u bazi podataka, molimo vas prijavite se\n"server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", PlayerInfo[playerid][Name]);
            spd(playerid, d_log, dsp, ""wwhp"Prijava na server", String, "Prijava", "Izlaz");
}
}
}
}
case d_pass: {
if(!response) return (false);
else{
strmid(RegPass[playerid], inputtext, 0, strlen(inputtext), 65);
}
}
case d_country: {
if(!response) return (false);
else {
switch(listitem) {
case 0: {
RegCountry[playerid] = 1;
}
case 1: {
RegCountry[playerid] = 2;
}
case 2: {
RegCountry[playerid] = 3;
}
case 3: {
RegCountry[playerid] = 4;
}
case 4: {
RegCountry[playerid] = 5;
}
case 5: {
RegCountry[playerid] = 6;
}
case 6: {
RegCountry[playerid] = 7;
}
case 7: {
RegCountry[playerid] = 8;
}
}
}
}
case d_ages: {
if(!response) return (false);
else {
if(strval(inputtext) < 8 || strval(inputtext) > 50) {
scm(playerid, -1, ""error"Ne mozete unijeti godine manje od 8 i vece od 50");
spd(playerid, d_ages, dsi, ""wwhp"Unos godina",""server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"server_col"--> "white"Sada vas molimo da unesete koliko imate godina u prazan dijalog\n\
"server_col"--> "white"Ne mozete ici manje od 8 i vise od 50 godina\n"server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~","Unos","Prekid");
return (false);
}
RegAges[playerid] = strval(inputtext);
}
}
case d_sex: {
if(!response) {
RegSex[playerid] = 2;
}
else {
RegSex[playerid] = 1;
}
}
        }
}

stock SavePlayer(playerid) {
new DB_Query[256];
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `users` SET `Score` = %d, `Cash` = %d, `Kills` = %d, `Deaths` = %d, `Admin` = %d, `Country` = %d, `Age` = %d, `Sex` = %d, \
`Tutorial` = %d, `AdminCode` = %d WHERE `ID` = %d LIMIT 1",
PlayerInfo[playerid][Score], PlayerInfo[playerid][Cash], PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Admin],PlayerInfo[playerid][Country],\
PlayerInfo[playerid][Ages],PlayerInfo[playerid][Sex], PlayerInfo[playerid][Tutorial], PlayerInfo[playerid][AdminCode], PlayerInfo[playerid][ID]);
mysql_tquery(Database, DB_Query);
return (true);
}
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Slika/video ingame problema(obavezno ako je ingame problem): //
« Poslednja izmena: Jun 05, 2020, 16:04:37 posle podne daddy. »
 

Van mreže musoviich

Odg: Reg/Log mysql bug
« Odgovor #1 poslato: Jun 04, 2020, 11:09:45 pre podne »
https://pastebin.com/9zLjXyhY

De prvo probaj sa onako default, kada uzmes od nekog, pa ga onda pokusaj editovat, moguce da si nesto izmjenio sto nisi trebao :P
 

Van mreže #bokenzi

Odg: Reg/Log mysql bug
« Odgovor #2 poslato: Jun 04, 2020, 11:11:09 pre podne »
https://pastebin.com/9zLjXyhY

De prvo probaj sa onako default, kada uzmes od nekog, pa ga onda pokusaj editovat, moguce da si nesto izmjenio sto nisi trebao :P
Po default fino sve radi, ali mi nikako nije jasno sta sam ovdje zeznio kad sam dodao pun vrag stvari u reg sistem
 

Van mreže musoviich

Odg: Reg/Log mysql bug
« Odgovor #3 poslato: Jun 04, 2020, 11:16:08 pre podne »
Problem(error/warning): Kad se ja registrujem na server, fino mi se zapise u databazu lozinka, spol drzava itd... Dok se drugi igrac registruje na server a ja sam u tom trenu aktivan, sve podatke koje on unese (lozinka, drzava, spol, godine...) se upise u moju tablicu pod mojim podacima, dok se njemu sve postavi na 0. Kada se ja disconectujem, meni se vrate moji zapisani registrovani podaci, dok drugom igracu je i dalje sve na 0. Postavit cu vam cijeli log/reg sistem, errora u mysql log nema, ukoliko vam nesto zatreba jos da provjerite, napisite mi :)
Dio skripte:
Pawno Code: [Izaberi]

public OnGameModeInit() {
new MySQLOpt: option_id = mysql_init_options();
mysql_set_option(option_id, AUTO_RECONNECT, true);
Database = mysql_connect(mysql_host, mysql_user, mysql_pass, mysql_database, option_id);
if(Database == MYSQL_INVALID_HANDLE || mysql_errno(Database) != 0) {
print("Connecting to MySQL database failed");
SendRconCommand("exit");
return (false);
}
        return (true);
}

public OnGameModeExit() {
foreach(new i: Player) {
Corrupt_Check[i]++;
SavePlayer(i);
if(cache_is_valid(PlayerInfo[i][Player_Cache])) {
cache_delete(PlayerInfo[i][Player_Cache]);
PlayerInfo[i][Player_Cache] = MYSQL_INVALID_CACHE;
}
}
mysql_close(Database);
}

public OnPlayerConnect(playerid) {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CreatePlayerTextDraws(playerid);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new DB_Query[115];
GetPlayerName(playerid, PlayerInfo[playerid][Name], MAX_PLAYER_NAME);
Corrupt_Check[playerid]++;
mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `users` WHERE `username` = `%e` LIMIT 1", PlayerInfo[playerid][Name]);
mysql_tquery(Database, DB_Query, "OnPlayerDataCheck", "ii", playerid, Corrupt_Check[playerid]);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
return (true);
}

forward OnPlayerDataCheck(playerid, corrupt_check);
public OnPlayerDataCheck(playerid, corrupt_check) {
if (corrupt_check != Corrupt_Check[playerid]) return Kick(playerid);
new rows;
cache_get_row_count(rows);
if(rows > 0) {
new String[512];
cache_get_value(0, "Password", PlayerInfo[playerid][Password], 65);
PlayerInfo[playerid][Player_Cache] = cache_save();
InterpolateCameraPos(playerid, 1294.575073, -1863.813354, 18.763757, 1384.041992, -885.596618, 71.000038, 30000);
InterpolateCameraLookAt(playerid, 1294.750732, -1858.821411, 18.541175, 1385.695800, -880.888000, 71.305839, 30000);
ClearChat(playerid);
format(String, sizeof(String), ""server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"server_col"--> "white"Dobrodosao "server_col"%s "white"na "server_col"Worldwide Community\n\
  "server_col"--> "white"Vas racun je pronadjen u bazi podataka, molimo vas prijavite se\n\
  "server_col"--> "white"Imate 30 sekundi da se prijavite na server\n"server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", PlayerInfo[playerid][Name]);
spd(playerid, d_log, dsp, ""wwhp"Prijava na server", String, "Prijava", "Izlaz");
LogKick[playerid] = SetTimerEx("LogKickTimer", 30000, false, "i", playerid);
}
else {
TogglePlayerSpectating(playerid, true);
InterpolateCameraPos(playerid, 1294.575073, -1863.813354, 18.763757, 1384.041992, -885.596618, 71.000038, 30000);
InterpolateCameraLookAt(playerid, 1294.750732, -1858.821411, 18.541175, 1385.695800, -880.888000, 71.305839, 30000);
for(new i=0; i<13; i++) {
ptds(playerid, RegisterTD[playerid][i]);
SelectTextDraw(playerid, 0x1783E2FF);
}
ptdh(playerid, RegisterTD[playerid][7]);
OnRegister[playerid] = 1;
ClearChat(playerid);
}
return (true);
}

public OnPlayerDisconnect(playerid, reason) {
foreach(new i: Player) {
Corrupt_Check[i]++;
SavePlayer(i);
if(cache_is_valid(PlayerInfo[i][Player_Cache])) {
cache_delete(PlayerInfo[i][Player_Cache]);
PlayerInfo[i][Player_Cache] = MYSQL_INVALID_CACHE;
}
       }

}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
switch (dialogid) {
case d_log: {
if(!response) return Kick(playerid);
else {
new account_pass[65];
SHA256_PassHash(inputtext, GetName(playerid), account_pass, 65);
if(strcmp(account_pass, PlayerInfo[playerid][Password]) == 0) {
cache_set_active(PlayerInfo[playerid][Player_Cache]);
            cache_get_value_int(0, "ID", PlayerInfo[playerid][ID]);
        cache_get_value_int(0, "Kills", PlayerInfo[playerid][Kills]);
        cache_get_value_int(0, "Deaths", PlayerInfo[playerid][Deaths]);
        cache_get_value_int(0, "Score", PlayerInfo[playerid][Score]);
        cache_get_value_int(0, "Cash", PlayerInfo[playerid][Cash]);
        cache_get_value_int(0, "Admin", PlayerInfo[playerid][Admin]);
        cache_get_value_int(0, "Country", PlayerInfo[playerid][Country]);
        cache_get_value_int(0, "Age", PlayerInfo[playerid][Ages]);
        cache_get_value_int(0, "Sex", PlayerInfo[playerid][Sex]);
        cache_get_value_int(0, "AdminCode", PlayerInfo[playerid][AdminCode]);
        SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
cache_delete(PlayerInfo[playerid][Player_Cache]);
PlayerInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE;
LoggedIn[playerid] = 1;
CreatePlayer(playerid);
KillTimer(LogKick[playerid]);
}
else {
    new String[512];
PlayerInfo[playerid][PasswordFails] += 1;
if (PlayerInfo[playerid][PasswordFails] >= 3) {
Kick(playerid);
}
else {
format(String, sizeof(String), ""error"Pogresna lozinka, imate jos %d od 3 pokusaja", PlayerInfo[playerid][PasswordFails]);
scm(playerid, -1, String);
              format(String, sizeof(String), ""server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"server_col"--> "white"Dobrodosao "server_col"%s "white"na "server_col"Worldwide Community\n\
              "server_col"--> "white"Vas racun je pronadjen u bazi podataka, molimo vas prijavite se\n"server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", PlayerInfo[playerid][Name]);
            spd(playerid, d_log, dsp, ""wwhp"Prijava na server", String, "Prijava", "Izlaz");
}
}
}
}
case d_pass: {
if(!response) return (false);
else{
strmid(RegPass[playerid], inputtext, 0, strlen(inputtext), 65);
}
}
case d_country: {
if(!response) return (false);
else {
switch(listitem) {
case 0: {
RegCountry[playerid] = 1;
}
case 1: {
RegCountry[playerid] = 2;
}
case 2: {
RegCountry[playerid] = 3;
}
case 3: {
RegCountry[playerid] = 4;
}
case 4: {
RegCountry[playerid] = 5;
}
case 5: {
RegCountry[playerid] = 6;
}
case 6: {
RegCountry[playerid] = 7;
}
case 7: {
RegCountry[playerid] = 8;
}
}
}
}
case d_ages: {
if(!response) return (false);
else {
if(strval(inputtext) < 8 || strval(inputtext) > 50) {
scm(playerid, -1, ""error"Ne mozete unijeti godine manje od 8 i vece od 50");
spd(playerid, d_ages, dsi, ""wwhp"Unos godina",""server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"server_col"--> "white"Sada vas molimo da unesete koliko imate godina u prazan dijalog\n\
"server_col"--> "white"Ne mozete ici manje od 8 i vise od 50 godina\n"server_col"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~","Unos","Prekid");
return (false);
}
RegAges[playerid] = strval(inputtext);
}
}
case d_sex: {
if(!response) {
RegSex[playerid] = 2;
}
else {
RegSex[playerid] = 1;
}
}
        }
}

stock SavePlayer(playerid) {
new DB_Query[256];
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `users` SET `Score` = %d, `Cash` = %d, `Kills` = %d, `Deaths` = %d, `Admin` = %d, `Country` = %d, `Age` = %d, `Sex` = %d, \
`Tutorial` = %d, `AdminCode` = %d WHERE `ID` = %d LIMIT 1",
PlayerInfo[playerid][Score], PlayerInfo[playerid][Cash], PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Admin],PlayerInfo[playerid][Country],\
PlayerInfo[playerid][Ages],PlayerInfo[playerid][Sex], PlayerInfo[playerid][Tutorial], PlayerInfo[playerid][AdminCode], PlayerInfo[playerid][ID]);
mysql_tquery(Database, DB_Query);
return (true);
}
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Slika/video ingame problema(obavezno ako je ingame problem): //

pregledaj svoje

Pawno Code: [Izaberi]
Corrupt_Check[playerid]++;
 
    new DB_Query[256];
    //Running a query to save the player`s data using the stored stuff.
    mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `CASH` = %d, `KILLS` = %d, `DEATHS` = %d WHERE `ID` = %d LIMIT 1",
    pInfo[playerid][Score], pInfo[playerid][Cash], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][ID]);
 
    mysql_tquery(Database, DB_Query);
 
    if(cache_is_valid(pInfo[playerid][Player_Cache])) //Checking if the player`s cache ID is valid.
    {
        cache_delete(pInfo[playerid][Player_Cache]); // Deleting the cache.
        pInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE; // Setting the stored player Cache as invalid.
    }
 
    pInfo[playerid][LoggedIn] = false;
    print("OnPlayerDisconnect has been called."); // Sending message once OnPlayerDisconnect is called.
    return 1;
Ovo sam ja izvukao iz default-nog OnPlayerDisconnect, pogledaj tu jel ti sta fali :)
 

Van mreže #bokenzi

Odg: Reg/Log mysql bug
« Odgovor #4 poslato: Jun 04, 2020, 11:20:54 pre podne »
pregledaj svoje

Pawno Code: [Izaberi]
Corrupt_Check[playerid]++;
 
    new DB_Query[256];
    //Running a query to save the player`s data using the stored stuff.
    mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `CASH` = %d, `KILLS` = %d, `DEATHS` = %d WHERE `ID` = %d LIMIT 1",
    pInfo[playerid][Score], pInfo[playerid][Cash], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][ID]);
 
    mysql_tquery(Database, DB_Query);
 
    if(cache_is_valid(pInfo[playerid][Player_Cache])) //Checking if the player`s cache ID is valid.
    {
        cache_delete(pInfo[playerid][Player_Cache]); // Deleting the cache.
        pInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE; // Setting the stored player Cache as invalid.
    }
 
    pInfo[playerid][LoggedIn] = false;
    print("OnPlayerDisconnect has been called."); // Sending message once OnPlayerDisconnect is called.
    return 1;
Ovo sam ja izvukao iz default-nog OnPlayerDisconnect, pogledaj tu jel ti sta fali :)

Ne fali mi nista, ja sam samo skratio, umjesto dugog procesa sam sve spremio u SavePlayer, obriso nebitan printf i to je to :)
 

Van mreže musoviich

Odg: Reg/Log mysql bug
« Odgovor #5 poslato: Jun 04, 2020, 11:27:09 pre podne »
Ne fali mi nista, ja sam samo skratio, umjesto dugog procesa sam sve spremio u SavePlayer, obriso nebitan printf i to je to :)

SavePlayer proces ti je uredu, pri registraciji korisnika negdje imas greksu.
Ukoliko pronadjem javim ti :)
 

Van mreže Darkic

Odg: Reg/Log mysql bug
« Odgovor #6 poslato: Jun 04, 2020, 11:35:18 pre podne »
Čemu foreach pod OnPlayerDisconnect?
 

Van mreže musoviich

Odg: Reg/Log mysql bug
« Odgovor #7 poslato: Jun 04, 2020, 11:49:44 pre podne »
Čemu foreach pod OnPlayerDisconnect?

Auu, to nisam ni vidio, vjerovatno tako misli kupit id igrača...
 

Van mreže #bokenzi

Odg: Reg/Log mysql bug
« Odgovor #8 poslato: Jun 04, 2020, 11:59:34 pre podne »
Čemu foreach pod OnPlayerDisconnect?
Ne killaju mi se timeri, nekad se ne spremaju neki podaci, zato stavim pod foreach
 

Van mreže #bokenzi

Odg: Reg/Log mysql bug
« Odgovor #9 poslato: Jun 04, 2020, 12:05:50 posle podne »
Fixano, problem je u ID, svi igraci imaju ID 0 u bazi podataka sve se promjesa, lockam