new pari,adm,spawn,pol,drz,god,em[150],sk,gm,lvl,exp,rep,kuk,rnt,stn,vik,fir,biz,mob,krd,bat,imn,kck,zpl,cig,ldr,cln,rk, idig; pari = GetPlayerMoney(playerid), adm = PlayerInfo[playerid][pAdmin], spawn = PlayerInfo[playerid][pSpawn], pol = PlayerInfo[playerid][pPol], drz = PlayerInfo[playerid][pDrzava], god = PlayerInfo[playerid][pGodini], em = PlayerInfo[playerid][pEmail], sk = PlayerInfo[playerid][pSkin], gm = PlayerInfo[playerid][pGM], lvl = PlayerInfo[playerid][pLevel], exp = PlayerInfo[playerid][pExp]; rep = PlayerInfo[playerid][pRep], kuk = PlayerInfo[playerid][pKukja], rnt = PlayerInfo[playerid][pRent], stn = PlayerInfo[playerid][pStan], vik = PlayerInfo[playerid][pVikendica], fir = PlayerInfo[playerid][pFirma], biz = PlayerInfo[playerid][pBiznis], mob = PlayerInfo[playerid][pMobilen], krd = PlayerInfo[playerid][pKredit], bat = PlayerInfo[playerid][pBaterija], imn = PlayerInfo[playerid][pImenik]; kck = PlayerInfo[playerid][pKocka], zpl = PlayerInfo[playerid][pZapalka], cig = PlayerInfo[playerid][pCigari], ldr = PlayerInfo[playerid][pLider], cln = PlayerInfo[playerid][pClen], rk = PlayerInfo[playerid][pRank], idig = PlayerInfo[playerid][pID]; new query[5000], Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Pari`='%d'', `Admin`='%d', `Spawn`='%d', `Pol`='%d', `Drzava`='%d', `Godini`='%d', `Email`='%e'', `Skin`='%d', `GM`='%d', `Level`='%d', `Exp`='%d', `Rep`='%d', `Kukja`='%d', `Rent`='%d', `Stan`='%d', `Vikendica`='%d', `Firma`='%d', `Biznis`='%d', `Mobilen`='%d', `Kredit`='%d', `Baterija`='%d', `Imenik`='%d', `Kocka`='%d', `Zapalka`='%d', `Cigari`='%d', `Lider`='%d', `Clen`='%d', `Rank`='%d WHERE `ID`='%d", pari, adm, spawn, pol, drz, god, em, sk, gm, lvl, exp, rep, kuk, rnt, stn, vik, fir, biz, mob, krd, bat, imn, kck, zpl, cig, ldr, cln, rk, idig); mysql_tquery(mysql, query, "", "");
Have you check your mysql logs? Does it say anything related to your problem?
I see at the end of it " ... `Rank`='%d WHERE `ID`='%d" that you opened ' but you didn't close it. |
stock OnAccountSave(playerid) { new query[5000]; mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Pari`='%d', `Admin`='%d', `Spawn`='%d', `Pol`='%d', `Drzava`='%d', `Godini`='%d', `Email`='%e', `Skin`='%d', `GM`='%d', `Level`='%d', `Exp`='%d', `Rep`='%d', `Kukja`='%d', `Rent`='%d', `Stan`='%d', `Vikendica`='%d', `Firma`='%d', `Biznis`='%d', `Mobilen`='%d', `Kredit`='%d', `Baterija`='%d', `Imenik`='%d', `Kocka`='%d', `Zapalka`='%d', `Cigari`='%d', `Lider`='%d', `Clen`='%d', `Rank`='%d' WHERE `ID`='%d'", GetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSpawn], PlayerInfo[playerid][pPol], PlayerInfo[playerid][pDrzava], PlayerInfo[playerid][pGodini], PlayerInfo[playerid][pEmail], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pGM], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pRep], PlayerInfo[playerid][pKukja], PlayerInfo[playerid][pRent], PlayerInfo[playerid][pStan], PlayerInfo[playerid][pVikendica], PlayerInfo[playerid][pFirma], PlayerInfo[playerid][pBiznis], PlayerInfo[playerid][pMobilen], PlayerInfo[playerid][pKredit], PlayerInfo[playerid][pBaterija], PlayerInfo[playerid][pImenik], PlayerInfo[playerid][pKocka], PlayerInfo[playerid][pZapalka], PlayerInfo[playerid][pCigari], PlayerInfo[playerid][pLider], PlayerInfo[playerid][pClen], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pID]); mysql_tquery(mysql, query, "", ""); }
Use 'INSERT' not 'UPDATE' , update it's for update the player stats ( if already exist ) , you put it when the player disconnect.
EDIT: do you have any warning with your code? |
print(query);
[00:34:14] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "server", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [00:34:14] [DEBUG] CMySQLHandle::Create - creating new connection.. [00:34:14] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [00:34:14] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [00:34:14] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [00:34:14] [DEBUG] CMySQLConnection::Connect - connection was successful [00:34:14] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [00:34:14] [DEBUG] mysql_errno - connection: 1 [00:34:14] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [00:34:14] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [00:34:14] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [00:34:14] [DEBUG] CMySQLConnection::Connect - connection was successful [00:34:14] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [00:34:14] [DEBUG] CMySQLConnection::Connect - connection was successful [00:34:14] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [00:34:14] [DEBUG] CMySQLConnection::Connect - connection was successful [00:34:14] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [00:34:47] [DEBUG] mysql_format - connection: 1, len: 1000, format: "SELECT `Password`, `ID` FROM `players` WHERE `Username` = '%e' LIMIT 1" [00:34:47] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Password`, `ID` FROM `players` WHERE `Username` = 'Rick_", callback: "OnAccountCheck", format: "i" [00:34:47] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution [00:34:47] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 23.453 milliseconds [00:34:47] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [00:34:47] [DEBUG] Calling callback "OnAccountCheck".. [00:34:47] [DEBUG] cache_get_data - connection: 1 [00:34:47] [DEBUG] cache_get_field_content - row: 0, field_name: "Password", connection: 1, max_len: 129 [00:34:47] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Password", data: "123" [00:34:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1 [00:34:47] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "9" [00:34:47] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [00:35:05] [DEBUG] mysql_format - connection: 1, len: 1000, format: "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1" [00:35:05] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `players` WHERE `Username` = 'Rick_Marley' LIMIT 1", callback: "OnAccountLoad", format: "i" [00:35:05] [DEBUG] CMySQLQuery::Execute[OnAccountLoad] - starting query execution [00:35:05] [DEBUG] CMySQLQuery::Execute[OnAccountLoad] - query was successfully executed within 0.282 milliseconds [00:35:05] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [00:35:05] [DEBUG] Calling callback "OnAccountLoad".. [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "9" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Pari", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Pari", data: "10000" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Admin", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Admin", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Spawn", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Spawn", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Pol", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Pol", data: "1" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Drzava", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Drzava", data: "1" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Godini", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Godini", data: "30" [00:35:05] [DEBUG] cache_get_field_content - row: 0, field_name: "Email", connection: 1, max_len: 150 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Email", data: "ilepopivanov2255@gmail.com" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Skin", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Skin", data: "7" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "GM", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "GM", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Level", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Level", data: "1" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Exp", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Exp", data: "57" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Rep", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Rep", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Kukja", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Kukja", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Rent", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Rent", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Stan", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Stan", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Vikendica", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Vikendica", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Biznis", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Biznis", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Mobilen", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Mobilen", data: "78841931" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Kredit", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Kredit", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Baterija", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Baterija", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Imenik", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Imenik", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Kocka", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Kocka", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Zapalka", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Zapalka", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Cigari", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Cigari", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Lider", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Lider", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Clen", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Clen", data: "0" [00:35:05] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Rank", connection: 1 [00:35:05] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Rank", data: "0" [00:35:05] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called