cache_get_field_content_int(row, const field_name[], connectionHandle = 1)
PlayerInfo[playerid][pSpawn] = cache_get_field_content_int(0, "Spawn"); PlayerInfo[playerid][pGender] = cache_get_field_content_int(0, "Gender"); PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level"); PlayerInfo[playerid][pEntered] = cache_get_field_content_int(0, "Entered"); PlayerInfo[playerid][pMinutes] = cache_get_field_content_int(0, "Minutes"); PlayerInfo[playerid][pTMinutes] = cache_get_field_content_int(0, "TMinutes"); PlayerInfo[playerid][pHours] = cache_get_field_content_int(0, "Hours"); PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age"); PlayerInfo[playerid][pADMute] = cache_get_field_content_int(0, "ADMute"); PlayerInfo[playerid][pModel] = cache_get_field_content_int(0, "Model"); PlayerInfo[playerid][pModel1] = cache_get_field_content_int(0, "Model1"); PlayerInfo[playerid][pModel2] = cache_get_field_content_int(0, "Model2"); PlayerInfo[playerid][pModel3] = cache_get_field_content_int(0, "Model3"); PlayerInfo[playerid][pMapper] = cache_get_field_content_int(0, "Mapper"); PlayerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned"); PlayerInfo[playerid][pNumber] = cache_get_field_content_int(0, "Number"); PlayerInfo[playerid][pKill] = cache_get_field_content_int(0, "Kill"); PlayerInfo[playerid][pDeath] = cache_get_field_content_int(0, "Death"); PlayerInfo[playerid][pInt] = cache_get_field_content_int(0, "Interior"); PlayerInfo[playerid][pVW] = cache_get_field_content_int(0, "Virtual World");
mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `VehVW`=%d, `WalkStyle`=%d, `Fac`=%d, `FacRank`=%d, `FacLeader`=%d, 'FacDiv'=%d, 'FacDivLeader'=%d, 'FacDuty'=%d, 'Weapon[0]'=%d, 'Weapon[1]'=%d WHERE `ID`=%d", PlayerInfo[playerid][pVehVW], PlayerInfo[playerid][pWalkStyle], PlayerInfo[playerid][pFac], PlayerInfo[playerid][pFacRank], PlayerInfo[playerid][pFacLeader], PlayerInfo[playerid][pFacDiv], PlayerInfo[playerid][pFacDivLeader], PlayerInfo[playerid][pFacDuty], PlayerInfo[playerid][pWeapon][0], PlayerInfo[playerid][pWeapon][1], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query, "", ""); mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Weapon[2]`=%d, `Weapon[3]`=%d, `Weapon[4]`=%d, `Weapon[5]`=%d, `Weapon[6]`=%d, 'Weapon[7]'=%d, 'Weapon[8]'=%d, 'Weapon[9]'=%d, 'Weapon[10]'=%d, 'Weapon[11]'=%d, 'Weapon[12]'=%d WHERE `ID`=%d", PlayerInfo[playerid][pWeapon][2], PlayerInfo[playerid][pWeapon][3], PlayerInfo[playerid][pWeapon][4], PlayerInfo[playerid][pWeapon][5], PlayerInfo[playerid][pWeapon][6], PlayerInfo[playerid][pWeapon][7], PlayerInfo[playerid][pWeapon][8], PlayerInfo[playerid][pWeapon][9], PlayerInfo[playerid][pWeapon][10], PlayerInfo[playerid][pWeapon][11], PlayerInfo[playerid][pWeapon][12], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query, "", "");
new query[518]; mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Admin`=%d, `Money`=%d, `posX`=%f, `posY`=%f, `posZ`=%f WHERE `ID`=%d", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query, "", ""); mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Gender`=%d, `Level`=%d, `Entered`=%d, `Minutes`=%d, `TMinutes`=%d, 'Hours'=%d, 'Age'=%d, 'Bank'=%d, 'Model'=%d, 'Model1'=%d WHERE `ID`=%d", PlayerInfo[playerid][pGender], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pEntered], PlayeInfo[playerid][pMinutes], PlayerInfo[playerid][pTMinutes], PlayerInfo[playerid][pHours], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pBank], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pModel1], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query, "", "");
PlayerInfo[playerid][pGender] = 1; //male
"... 'Hours'=%d, 'Age'=%d, 'Bank'=%d, 'Model'=%d, 'Model1'=%d ..."
You used '' around the fields name instead of ``. |
"UPDATE users SET Gender=%d, Level=%d, Entered=%d, Minutes=%d, TMinutes=%d, Hours=%d, Age=%d, Bank=%d, Model=%d, Model1=%d WHERE ID=%d"
PlayerInfo[playerid][pSpawn] = cache_get_field_content_int(0, "Spawn"); PlayerInfo[playerid][pGender] = cache_get_field_content_int(0, "Gender"); PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level"); PlayerInfo[playerid][pEntered] = cache_get_field_content_int(0, "Entered"); PlayerInfo[playerid][pMinutes] = cache_get_field_content_int(0, "Minutes"); PlayerInfo[playerid][pTMinutes] = cache_get_field_content_int(0, "TMinutes"); PlayerInfo[playerid][pHours] = cache_get_field_content_int(0, "Hours"); PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age"); PlayerInfo[playerid][pADMute] = cache_get_field_content_int(0, "ADMute"); PlayerInfo[playerid][pModel] = cache_get_field_content_int(0, "Model"); PlayerInfo[playerid][pModel1] = cache_get_field_content_int(0, "Model1"); PlayerInfo[playerid][pModel2] = cache_get_field_content_int(0, "Model2"); PlayerInfo[playerid][pModel3] = cache_get_field_content_int(0, "Model3"); PlayerInfo[playerid][pMapper] = cache_get_field_content_int(0, "Mapper"); PlayerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned"); PlayerInfo[playerid][pNumber] = cache_get_field_content_int(0, "Number"); PlayerInfo[playerid][pKill] = cache_get_field_content_int(0, "Kill"); PlayerInfo[playerid][pDeath] = cache_get_field_content_int(0, "Death"); PlayerInfo[playerid][pInt] = cache_get_field_content_int(0, "Interior"); PlayerInfo[playerid][pVW] = cache_get_field_content_int(0, "Virtual World");
WHERE `ID`=%d"
When a player connects, the only thing you know is their name, not their unique ID to the database so you'll use the name for loading and ID for saving (like you have it most likely).
|