07.07.2014, 21:36
Hey, sorry for seeming like a noob, but I've been working on converting BlueG's MYSQL Clothing System to the older version of a_mysql.inc (so I don't have to convert my gamemode of 14k lines just yet.
There is some issues with loading clothes, everything else but loading works so I'm interested in some expertise in this field by someone who knows how to do this stuff. I've been stuck with this problem for three days now, so if anyone here knows a solution, It'd be appreaciateful.
CODE:
The database.
Result of code:
[/QUOTE]
There is some issues with loading clothes, everything else but loading works so I'm interested in some expertise in this field by someone who knows how to do this stuff. I've been stuck with this problem for three days now, so if anyone here knows a solution, It'd be appreaciateful.
CODE:
PHP код:
stock LoadPlayerClothes(playerid)
{
format(query, sizeof(query), "SELECT * FROM `clothes` WHERE `holder` = '%s'", GetName(playerid));
mysql_query(query);
mysql_store_result();
new
i = 1;
new xid, xmodel, xbone, xoffsetx, xoffsety, xoffsetz, xrotx, xroty, xrotz, xscalex, xscaley, xscalez;
if(mysql_num_rows() > 0) {
while(mysql_fetch_row_format(query, "|")) {
mysql_fetch_row(query);
sscanf(query, "p<|>iiifffffffff", cID, cModelID, cBoneID, cOffsetX, cOffsetY, cOffsetZ, cRotX, cRotY, cRotZ, cScaleX, cScaleY, cScaleZ);
ClothesInfo[playerid][i][xid] = mysql_fetch_field_row(query, "id");
ClothesInfo[playerid][i][xmodel] = mysql_fetch_field_row(query, "model");
ClothesInfo[playerid][i][xbone] = mysql_fetch_field_row(query, "bone");
ClothesInfo[playerid][i][xoffsetx] = mysql_fetch_field_row(query, "offsetx");
ClothesInfo[playerid][i][xoffsetx] = mysql_fetch_field_row(query, "offsety");
ClothesInfo[playerid][i][xoffsetz] = mysql_fetch_field_row(query, "offsetz");
ClothesInfo[playerid][i][xrotx] = mysql_fetch_field_row(query, "rotx");
ClothesInfo[playerid][i][xroty] = mysql_fetch_field_row(query, "roty");
ClothesInfo[playerid][i][xrotz] = mysql_fetch_field_row(query, "rotz");
ClothesInfo[playerid][i][xscalex] = mysql_fetch_field_row(query, "scalex");
ClothesInfo[playerid][i][xscaley] = mysql_fetch_field_row(query, "scaley");
ClothesInfo[playerid][i][xscalez] = mysql_fetch_field_row(query, "scalez");
ClothesInfo[playerid][i][cOn] = true;
i++;
clTotal++;
}
}
mysql_free_result();
printf("%i clothing items loaded from the MySQL Database.", clTotal);
return 1;
}
public OnPlayerConnect(playerid)
{
LoadPlayerClothes(playerid);
return 1;
}
The database.
Result of code:
[/QUOTE]