03.03.2013, 13:59
I'm making a furniture system and when the player buys the furniture it creates the object, but the object hides himself
Only after I restart the server I can see the object:
Here are my codes:
After player buys:
On loading the houses furnitures, which makes the object in the right position..
Only after I restart the server I can see the object:
Here are my codes:
After player buys:
pawn Код:
public OnFurnitureInsert(playerid, houseid, interior, world, furnitureslot, model, price, name, Float:x, Float:y, Float:z)
{
FurnitureInfo[houseid][furnitureslot][fID] = mysql_insert_id();
FurnitureInfo[houseid][furnitureslot][fHouseID] = houseid;
FurnitureInfo[houseid][furnitureslot][fInterior] = interior;
FurnitureInfo[houseid][furnitureslot][fVirtualWorld] = world;
FurnitureInfo[houseid][furnitureslot][fMarketPrice] = price;
FurnitureInfo[houseid][furnitureslot][fModel] = model;
FurnitureInfo[houseid][furnitureslot][fPosX] = x;
FurnitureInfo[houseid][furnitureslot][fPosY] = y;
FurnitureInfo[houseid][furnitureslot][fPosZ] = z;
FurnitureInfo[houseid][furnitureslot][fPosRX] = 0.0;
FurnitureInfo[houseid][furnitureslot][fPosRY] = 0.0;
FurnitureInfo[houseid][furnitureslot][fPosRZ] = 0.0;
format(FurnitureInfo[houseid][furnitureslot][fName], 128, "%s", name);
FurnitureInfo[houseid][furnitureslot][fOn] = 1;
FurnitureInfo[houseid][furnitureslot][fObject] = CreateDynamicObject(model, FurnitureInfo[houseid][furnitureslot][fPosX], FurnitureInfo[houseid][furnitureslot][fPosY], FurnitureInfo[houseid][furnitureslot][fPosZ], FurnitureInfo[houseid][furnitureslot][fPosRX], FurnitureInfo[houseid][furnitureslot][fPosRY], FurnitureInfo[houseid][furnitureslot][fPosRZ], FurnitureInfo[houseid][furnitureslot][fVirtualWorld], FurnitureInfo[houseid][furnitureslot][fInterior], -1, 200.0);
return 1;
}
pawn Код:
public OnFurnituresLoad(houseid)
{
new rows, fields;
new total = 0;
cache_get_data(rows, fields);
if(rows)
{
while(total < rows)
{
FurnitureInfo[houseid][total][fID] = cache_get_row_int(total, 0);
FurnitureInfo[houseid][total][fModel] = cache_get_row_int(total, 1);
cache_get_row(total, 2, FurnitureInfo[houseid][total][fName], dbHandle, 128);
FurnitureInfo[houseid][total][fHouseID] = houseid;
FurnitureInfo[houseid][total][fInterior] = cache_get_row_int(total, 4);
FurnitureInfo[houseid][total][fVirtualWorld] = cache_get_row_int(total, 5);
FurnitureInfo[houseid][total][fMarketPrice] = cache_get_row_int(total, 6);
FurnitureInfo[houseid][total][fPosX] = cache_get_row_float(total, 7);
FurnitureInfo[houseid][total][fPosY] = cache_get_row_float(total, 8);
FurnitureInfo[houseid][total][fPosZ] = cache_get_row_float(total, 9);
FurnitureInfo[houseid][total][fPosRX] = cache_get_row_float(total, 10);
FurnitureInfo[houseid][total][fPosRY] = cache_get_row_float(total, 11);
FurnitureInfo[houseid][total][fPosRZ] = cache_get_row_float(total, 12);
FurnitureInfo[houseid][total][fOn] = 1;
FurnitureInfo[houseid][total][fObject] = CreateDynamicObject(FurnitureInfo[houseid][total][fModel], FurnitureInfo[houseid][total][fPosX], FurnitureInfo[houseid][total][fPosY], FurnitureInfo[houseid][total][fPosZ], FurnitureInfo[houseid][total][fPosRX], FurnitureInfo[houseid][total][fPosRY], FurnitureInfo[houseid][total][fPosRZ], FurnitureInfo[houseid][total][fVirtualWorld], FurnitureInfo[houseid][total][fInterior], -1, 200.0);
total++;
}
}
return 1;
}