Hello everyone okay so i tried making a furniture system, everything works fine, i can buy the object, edit it but when i click save the object disappear? And im trying to find the issue but i cant find it.
PHP код:
if(response == EDIT_RESPONSE_FINAL)
{
new houseid = House_Inside(playerid);
if(houseid >= 0 && HasFPrems(playerid, houseid))
{
if(p_Info[playerid][pCash] < furnitureObj[p_Info[playerid][pSelect]][fCost])
{
return SendClientMessage(playerid, COLOR_GREY, "You couldn't afford to purchase this item.");
}
new
string[16];
GivePlayerCash(playerid, -furnitureObj[p_Info[playerid][pSelect]][fCost]);
mysql_format(connect, queryBuffer, sizeof(queryBuffer), "INSERT INTO furniture VALUES(null, %i, %i, '%e', %i, '%f', '%f', '%f', '%f', '%f', '%f', %i, %i, 0, 0)", h_Info[houseid][hSQLId], furnitureObj[p_Info[playerid][pSelect]][fModel], furnitureObj[p_Info[playerid][pSelect]][fName], furnitureObj[p_Info[playerid][pSelect]][fCost], x, y, z, rx, ry, rz, h_Info[houseid][hIntIW], h_Info[houseid][hIntVW]);
mysql_tquery(connect, queryBuffer);
mysql_tquery(connect, "SELECT * FROM furniture WHERE id = LAST_INSERT_ID()", "OnMysqlFinish", "ii", LOAD_FURNITURE, h_Info[houseid][hLabels]);
format(string, sizeof(string), "~r~-$%i", furnitureObj[p_Info[playerid][pSelect]][fCost]);
GameTextForPlayer(playerid, string, 5000, 1);
}
}
case LOAD_FURNITURE:
{
for(new i = 0; i < rowsa; i ++)
{
new objectid = CreateDynamicObject(cache_get_field_content_int(i, "modelid"), cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"), cache_get_field_content_float(i, "rot_x"), cache_get_field_content_float(i, "rot_y"), cache_get_field_content_float(i, "rot_z"), cache_get_field_content_int(i, "world"), cache_get_field_content_int(i, "interior"));
Streamer_SetExtraInt(objectid, E_OBJECT_TYPE, E_OBJECT_FURNITURE);
Streamer_SetExtraInt(objectid, E_OBJECT_INDEX_ID, cache_get_field_content_int(i, "id"));
Streamer_SetExtraInt(objectid, E_OBJECT_EXTRA_ID, cache_get_field_content_int(i, "houseid"));
if(extraid)
{
new
string[48];
cache_get_field_content(i, "name", string);
format(string, sizeof(string), "[%i] - %s", objectid, string);
Streamer_SetExtraInt(objectid, E_OBJECT_3DTEXT_ID, _:CreateDynamic3DTextLabel(string, COLOR_GREY, cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"), 10.0, .worldid = cache_get_field_content_int(i, "world"), .interiorid = cache_get_field_content_int(i, "interior")));
}
}
}
Код:
if(response == EDIT_RESPONSE_FINAL)
{
new houseid = House_Inside(playerid);
if(houseid >= 0 && HasFPrems(playerid, houseid))
{
if(p_Info[playerid][pCash] < furnitureObj[p_Info[playerid][pSelect]][fCost])
{
return SendClientMessage(playerid, COLOR_GREY, "You couldn't afford to purchase this item.");
}
new
string[16];
GivePlayerCash(playerid, -furnitureObj[p_Info[playerid][pSelect]][fCost]);
mysql_format(connect, queryBuffer, sizeof(queryBuffer), "INSERT INTO furniture VALUES(null, %i, %i, '%e', %i, '%f', '%f', '%f', '%f', '%f', '%f', %i, %i, 0, 0)", h_Info[houseid][hSQLId], furnitureObj[p_Info[playerid][pSelect]][fModel], furnitureObj[p_Info[playerid][pSelect]][fName], furnitureObj[p_Info[playerid][pSelect]][fCost], x, y, z, rx, ry, rz, h_Info[houseid][hIntIW], h_Info[houseid][hIntVW]);
mysql_tquery(connect, queryBuffer);
mysql_tquery(connect, "SELECT * FROM furniture WHERE id = LAST_INSERT_ID()", "OnMysqlFinish", "ii", LOAD_FURNITURE, h_Info[houseid][hLabels]);
format(string, sizeof(string), "~r~-$%i", furnitureObj[p_Info[playerid][pSelect]][fCost]);
GameTextForPlayer(playerid, string, 5000, 1);
SetDynamicObjectPos(objectid,x,y,z);
SetDynamicObjectRot(objectid,rx,ry,rz);
}
}
This because the ingame editor doesn't save automatically the new position.