SA-MP Forums Archive
Accessories not saving - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Accessories not saving (/showthread.php?tid=613772)



Accessories not saving - GoldenLion - 31.07.2016

Hi, I've just changed the accessory system in my gamemode, but none of them are saving. Also hats and masks are invisible on player. Bags work, but they don't save.
Here's the saving code:
Код:
SQL_SaveAccessories(playerid)
{
    if (!PlayerData[playerid][pLogged])
		return 0;

	new
	    query[768];

    format(query, sizeof(query), "UPDATE `characters` SET `Glasses` = '%d', `Hat` = '%d', `Mask` = '%d', `Bag` = '%d', `Item` = '%d', `GlassesBone` = '%d', `HatBone` = '%d', `MaskBone` = '%d', `BagBone` = '%d', `ItemBone` = '%d', `GlassesPos` = '%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f'",
        PlayerData[playerid][pGlasses],
	PlayerData[playerid][pHat],
        PlayerData[playerid][pMask],
	PlayerData[playerid][pBag],
        PlayerData[playerid][pItem],
	PlayerData[playerid][pGlassesBone],
	PlayerData[playerid][pHatBone],
        PlayerData[playerid][pMaskBone],
	PlayerData[playerid][pBagBone],
	PlayerData[playerid][pItemBone],
	AccessoryData[playerid][0][0],
        AccessoryData[playerid][0][1],
        AccessoryData[playerid][0][2],
        AccessoryData[playerid][0][3],
        AccessoryData[playerid][0][4],
        AccessoryData[playerid][0][5],
        AccessoryData[playerid][0][6],
        AccessoryData[playerid][0][7],
        AccessoryData[playerid][0][8]
	);
    format(query, sizeof(query), "%s, `HatPos` = '%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f'",
        query,
		AccessoryData[playerid][1][0],
        AccessoryData[playerid][1][1],
        AccessoryData[playerid][1][2],
        AccessoryData[playerid][1][3],
        AccessoryData[playerid][1][4],
        AccessoryData[playerid][1][5],
        AccessoryData[playerid][1][6],
        AccessoryData[playerid][1][7],
        AccessoryData[playerid][1][8]
	);
	format(query, sizeof(query), "%s, `MaskPos` = '%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f'",
	    query,
		AccessoryData[playerid][2][0],
        AccessoryData[playerid][2][1],
        AccessoryData[playerid][2][2],
        AccessoryData[playerid][2][3],
        AccessoryData[playerid][2][4],
        AccessoryData[playerid][2][5],
        AccessoryData[playerid][2][6],
        AccessoryData[playerid][2][7],
        AccessoryData[playerid][2][8]
	);
    format(query, sizeof(query), "%s, `BagPos` = '%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f'",
        query,
		AccessoryData[playerid][3][0],
        AccessoryData[playerid][3][1],
        AccessoryData[playerid][3][2],
        AccessoryData[playerid][3][3],
        AccessoryData[playerid][3][4],
        AccessoryData[playerid][3][5],
        AccessoryData[playerid][3][6],
        AccessoryData[playerid][3][7],
        AccessoryData[playerid][3][8]
	);
	format(query, sizeof(query), "%s, `ItemPos` = '%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f|%.4f' WHERE `ID` = '%d'",
	    query,
		AccessoryData[playerid][4][0],
        AccessoryData[playerid][4][1],
        AccessoryData[playerid][4][2],
        AccessoryData[playerid][4][3],
        AccessoryData[playerid][4][4],
        AccessoryData[playerid][4][5],
        AccessoryData[playerid][4][6],
        AccessoryData[playerid][4][7],
        AccessoryData[playerid][4][8],
        PlayerData[playerid][pID]
	);
	mysql_tquery(g_iHandle, query);
	return 1;
}
What's wrong with it?


Re: Accessories not saving - Sirop - 31.07.2016

EDIT fail


Re: Accessories not saving - GoldenLion - 31.07.2016

Fixed, I had BandanaPos instead of MaskPos in the database...