13.04.2019, 09:22
So i have a skin system and i can't get the skins to save into the database,here's my saving function
SaveSkin(playerid)
{
new query[128];
mysql_format(SQL, query, sizeof(query), "UPDATE users SET `Skin` = '%d|%d|%d|%d|%d|%d|%d|%d|%d|%d' WHERE `name` = '%d'", PlayerInfo[playerid][pSkin][0], PlayerInfo[playerid][pSkin][1], PlayerInfo[playerid][pSkin][2], PlayerInfo[playerid][pSkin][3], PlayerInfo[playerid][pSkin][4],
PlayerInfo[playerid][pSkin][5], PlayerInfo[playerid][pSkin][6], PlayerInfo[playerid][pSkin][7], PlayerInfo[playerid][pSkin][8], PlayerInfo[playerid][pSkin][9], PlayerInfo[playerid][pNormalName]);
mysql_tquery(SQL, query, "", "");
}
and here's how im reading the skins from the data base
cache_get_field_content(0, "Skin", result); format(skin, 64, result);
sscanf(skin, "p<|>iiiiiiiiii", PlayerInfo[playerid][pSkin][0], PlayerInfo[playerid][pSkin][1], PlayerInfo[playerid][pSkin][2], PlayerInfo[playerid][pSkin][3], PlayerInfo[playerid][pSkin][4],
PlayerInfo[playerid][pSkin][5], PlayerInfo[playerid][pSkin][6], PlayerInfo[playerid][pSkin][7], PlayerInfo[playerid][pSkin][8], PlayerInfo[playerid][pSkin][9]);
and in the data base the format is like this at the `skin` column(as defined)
250|-1|-1|-1|-1|-1|-1|-1|-1|-1
and no,the problem is not with any other part of the code cause where im reading from the database the skins im also reading everything like name,pp,money etc,like absolutely everything and i don't have a problem with anything else
SaveSkin(playerid)
{
new query[128];
mysql_format(SQL, query, sizeof(query), "UPDATE users SET `Skin` = '%d|%d|%d|%d|%d|%d|%d|%d|%d|%d' WHERE `name` = '%d'", PlayerInfo[playerid][pSkin][0], PlayerInfo[playerid][pSkin][1], PlayerInfo[playerid][pSkin][2], PlayerInfo[playerid][pSkin][3], PlayerInfo[playerid][pSkin][4],
PlayerInfo[playerid][pSkin][5], PlayerInfo[playerid][pSkin][6], PlayerInfo[playerid][pSkin][7], PlayerInfo[playerid][pSkin][8], PlayerInfo[playerid][pSkin][9], PlayerInfo[playerid][pNormalName]);
mysql_tquery(SQL, query, "", "");
}
and here's how im reading the skins from the data base
cache_get_field_content(0, "Skin", result); format(skin, 64, result);
sscanf(skin, "p<|>iiiiiiiiii", PlayerInfo[playerid][pSkin][0], PlayerInfo[playerid][pSkin][1], PlayerInfo[playerid][pSkin][2], PlayerInfo[playerid][pSkin][3], PlayerInfo[playerid][pSkin][4],
PlayerInfo[playerid][pSkin][5], PlayerInfo[playerid][pSkin][6], PlayerInfo[playerid][pSkin][7], PlayerInfo[playerid][pSkin][8], PlayerInfo[playerid][pSkin][9]);
and in the data base the format is like this at the `skin` column(as defined)
250|-1|-1|-1|-1|-1|-1|-1|-1|-1
and no,the problem is not with any other part of the code cause where im reading from the database the skins im also reading everything like name,pp,money etc,like absolutely everything and i don't have a problem with anything else