16.07.2014, 11:05
Hey,
I'm getting an error 1064 error on this code, meaning the SQL syntax is somehow wrong. After quite some time trying to fix it it still did not help, so if anyone could help me it'd be great. This is the code:
I'm getting an error 1064 error on this code, meaning the SQL syntax is somehow wrong. After quite some time trying to fix it it still did not help, so if anyone could help me it'd be great. This is the code:
pawn Код:
new query[800], name[24], totalquery[3000];
GetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
PlayerInfo[playerid][pVW]= GetPlayerVirtualWorld(playerid);
GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
GetPlayerName(playerid, name, sizeof(name));
format(totalquery, sizeof(totalquery), "UPDATE players SET pPos_x = %f, pPos_y = %f, pPos_z = %f,", PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
format(query, sizeof(query), "pCash = %d, pBank = %d, pAdmin = %d, pFacMod = %d, pPrimaryGun = %d,", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pBank], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pFacMod], PlayerInfo[playerid][pPrimaryGun]);
strcat(totalquery, query);
format(query, sizeof(query), "pPrimaryGunAmmo = %d, pPrimaryGunDesc = '%s', pSecondaryGun = %d, pSecondaryGunAmmo = %d, pSecondaryGunDesc = '%s', ", PlayerInfo[playerid][pPrimaryGunAmmo], PlayerInfo[playerid][pPrimaryGunDesc], PlayerInfo[playerid][pSecondaryGun], PlayerInfo[playerid][pSecondaryGunAmmo], PlayerInfo[playerid][pSecondaryGunDesc]);
strcat(totalquery, query);
format(query, sizeof(query), "pMeleeWeapon = %d, pSpecialWeapon = %d, pAdminName = '%s', pRank = '%s', pSex = %d, pHealth = %f, pArmor = %f, ", PlayerInfo[playerid][pMeleeWeapon], PlayerInfo[playerid][pSpecialWeapon], PlayerInfo[playerid][pAdminName], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pArmor]);
strcat(totalquery, query);
format(query, sizeof(query), "pRadio = %d, pMorphine = %d, pBandages = %d, pTazer = %d, pFirstAid = %d, pAge = %d, pInt = %d, pVW = %d, ", PlayerInfo[playerid][pRadio], PlayerInfo[playerid][pMorphine], PlayerInfo[playerid][pBandages], PlayerInfo[playerid][pTazer], PlayerInfo[playerid][pFirstAid], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pVW]);
strcat(totalquery, query);
format(query, sizeof(query), "pBanned = %d, pBanReason = '%s', pLastIP = '%s', pSkin = %d, pHouse = %d, pAjailTime = %d, pRegPending = %d, ", PlayerInfo[playerid][pBanned], PlayerInfo[playerid][pBanReason], PlayerInfo[playerid][pLastIP], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pHouse], PlayerInfo[playerid][pAjailTime], PlayerInfo[playerid][pRegPending]);
strcat(totalquery, query);
format(query, sizeof(query), "pRegStep = %d, pFaction = %d, pFacPermission = %d, pQuiz1 = '%s', pQuiz2 = '%s', pQuiz3 = '%s', pQuiz4 = '%s', pQuiz5 = '%s', ", PlayerInfo[playerid][pRegStep], PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pFacPermission], PlayerInfo[playerid][pQuiz1], PlayerInfo[playerid][pQuiz2], PlayerInfo[playerid][pQuiz3], PlayerInfo[playerid][pQuiz4], PlayerInfo[playerid][pQuiz5]);
strcat(totalquery, query);
format(query, sizeof(query), "pQuiz6 = '%s', pQuiz7 = '%s', pQuiz8 = '%s', pQuiz9 = '%s', pAjailReason = '%s', pProbationTeam = %d, pInfractions = %d, ", PlayerInfo[playerid][pQuiz6], PlayerInfo[playerid][pQuiz7], PlayerInfo[playerid][pQuiz8], PlayerInfo[playerid][pQuiz9], PlayerInfo[playerid][pAjailReason], PlayerInfo[playerid][pProbationTeam], PlayerInfo[playerid][pInfractions]);
strcat(totalquery, query);
format(query, sizeof(query), "pInfractionTimer = %d, pSuspended = %d, pFlag = '%s', pReportMuted = %d, pHelpMuted = %d, pHospital = %d WHERE NormalName = '%s'", PlayerInfo[playerid][pInfractionTimer], PlayerInfo[playerid][pSuspended], PlayerInfo[playerid][pFlag], PlayerInfo[playerid][pReportMuted], PlayerInfo[playerid][pHelpMuted], PlayerInfo[playerid][pHospital], name);
strcat(totalquery, query);
mysql_function_query(ConnectionHandle, query, true, "SavePlayerDone", "");
return 1;