30.08.2018, 13:15
Код:
SaveAchievements(playerid) { new _query[74]; mysql_format(handle, _query, sizeof(_query), "DELETE FROM `achievements` WHERE `Username` = %s", pInfo[playerid][pUsername]); mysql_tquery(handle, _query); for(new i; i<sizeof(AchievementInfo); i++) { if(pAch[playerid][E_PlayerAchievements:i]) { mysql_format(handle, _query, sizeof(_query), "INSERT INTO `achievements` (`AchID`) VALUES (%d)", i); mysql_tquery(handle, _query); } } return 1; }
Like, I got an achievement. My Username is DarkMythHunter and my id is 1. I would like the achievement data to be saved into mysql. I want to get the ID, and save it in achievement table. Same for username.
The table achievement have 3 row;
AccountID
Username
AchID
If user DarkMythHunter got an achievement, then his ID in the database, not the ID ingame will be into "AccountID", the username will be under "Username".
Im not that good explaining this one, sorry. Thanks for those who will help me out.