EnAcHe Posted May 14, 2016 Report Share Posted May 14, 2016 Nu mi se salveaza pinul in baza de date. Tabelul e creat sub forma `Pin` varchar(10) NOT NULL DEFAULT '0', Eu am facut o salvare cam asa: #define pPinx 110 case pPinx: { mysql_format(SQL, var, sizeof(var), "UPDATE `users` SET `Pin`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pPin], PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,var,"",""); } Update(playerid, pPinx); Quote Link to comment Share on other sites More sharing options...
EnAcHe Posted May 14, 2016 Author Report Share Posted May 14, 2016 Up Quote Link to comment Share on other sites More sharing options...
EnAcHe Posted May 14, 2016 Author Report Share Posted May 14, 2016 Up Quote Link to comment Share on other sites More sharing options...
Alberto. Posted May 15, 2016 Report Share Posted May 15, 2016 (edited) Nu e suficient ce ai facut tu, trebuie sa preiei din baza de date datele. ex: new query[500]; format(query,100,"SELECT * FROM users WHERE `name`='%s' AND `Pin`='%s'",PlayerInfo[playerid][pNormalName],PlayerInfo[playerid][pPin]); new Cache: pin = mysql_query(SQL,query); if(cache_get_row_count() > 0) { cache_get_field_content(0, "name", PlayerInfo[playerid][pNormalName], SQL, 130); PlayerInfo[playerid][pPin] = cache_get_field_content_int(0, "Pin"); } Spoiler Alte informatii: 1. Daca esti in ceata, ce am scris mai sus il poti pune la OnPlayerLogin 2. E foarte probabil sa ai in gamemode aceste salvari si sa fii nevoit sa adaugi doar 'PlayerInfo[playerid][pPin] = cache_get_field_content_int(0, "Pin");' Edited May 15, 2016 by Alberto. Quote Link to comment Share on other sites More sharing options...
EnAcHe Posted May 15, 2016 Author Report Share Posted May 15, 2016 'PlayerInfo[playerid][pPin] = cache_get_field_content_int(0, "Pin");' am adaugat aia de mult Am facut si ce ai zis tu si tot nu merge Quote Link to comment Share on other sites More sharing options...
Jamal Alin Posted May 15, 2016 Report Share Posted May 15, 2016 syntaxa nu e corecta, trebuia sa verifici mysql.log . mysql_format(SQL, var, sizeof(var), "UPDATE users SET Pin=%d WHERE name='%s'",PlayerInfo[playerid][pPin], PlayerInfo[playerid][pNormalName]); mysql_query(SQL,var); Asa e corect formulat ! Quote Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!! http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.