Help furniture
#1

Hi all.

- I recently added a gaming system, everything is ok, it saves the objects in the database and works perfectly, after the first restart I show only the last object added not the rest of the objects. I do not understand what might be the problem. Thank you!

* Picture with object added (save)
https://imgur.com/EFTrt6C
https://imgur.com/xUTcp9Y

* Picture after restart, before it shows me that there are 3 out of 30 and now 1 out of 30
https://imgur.com/VThxQae
https://imgur.com/EXGO6vc - This is where objects are saved

PHP код:
pc LoadFurnitures()
{
    new 
objects = 0;
    
Total_FUR_Created = cache_num_rows();
    new 
i,x;
    for(
i=0;i<Total_FUR_Created;i++)
    {
        
objects ++;
           
cache_get_value_int(i, "ID",            FurnitureInfo[x][fiID]);
           
cache_get_value_int(i, "Model",         FurnitureInfo[x][fiModel]);
           
cache_get_value_float(i, "X",           FurnitureInfo[x][fiX]);
         
cache_get_value_float(i, "Y",           FurnitureInfo[x][fiY]);
          
cache_get_value_float(i, "Z",           FurnitureInfo[x][fiZ]);
           
cache_get_value_float(i, "RotX",        FurnitureInfo[x][fiRotX]);
           
cache_get_value_float(i, "RotY",        FurnitureInfo[x][fiRotY]);
           
cache_get_value_float(i, "RotZ",        FurnitureInfo[x][fiRotZ]);
           
cache_get_value_int(i, "Virtual",       FurnitureInfo[x][fiVirtual]);
           
cache_get_value_int(i, "House",         FurnitureInfo[x][fiHouse]);
        
FurnitureInfo[x][fiObject] = CreateDynamicObject(FurnitureInfo[x][fiModel], FurnitureInfo[x][fiX], FurnitureInfo[x][fiY], FurnitureInfo[x][fiZ], FurnitureInfo[x][fiRotX], FurnitureInfo[x][fiRotY], FurnitureInfo[x][fiRotZ], FurnitureInfo[x][fiVirtual], -1, -1, 200.0);
    }
    print(
"=============================================================");
    
printf("[GAMEMODE]:         Furniture Sistem Loaded %d object's", objects);
    print(
"=============================================================\n");
    return 
1;
} 
PHP код:
pc SaveObject(const id) 
{
    
format(query,sizeof(query),"UPDATE `fobjects` SET `Model`='%d', `X`='%f', `Y`='%f', `Z`='%f', `RotX`='%f', `RotY`='%f', `RotZ`='%f', `Virtual`='%d', `House`='%d' WHERE `ID`='%d'",
    
FurnitureInfo[id][fiModel], FurnitureInfo[id][fiX], FurnitureInfo[id][fiY], FurnitureInfo[id][fiZ], FurnitureInfo[id][fiRotX], FurnitureInfo[id][fiRotY], FurnitureInfo[id][fiRotZ], FurnitureInfo[id][fiVirtual], FurnitureInfo[id][fiHouse], id);
    
mysql_tquery(handle, query);
    return 
1;
} 
PHP код:
stock GetHouseObjects(houseid) 
{
    new 
x;
    for(new 
i = 0; i != sizeof(FurnitureInfo); i++)
    {
        if(
FurnitureInfo[i][fiHouse] == houseid) x++;
    }
    return 
x;
} 
and

PHP код:
 format(strong,sizeof(strong),    "{f9f7ce}Numele casei \t%s\n\
                                         {f9f7ce}Chirie \t%s\n\
                                         {f9f7ce}Casa inchisa \t%s\n\
                                         {f9f7ce}Bani in casa \t%s$\n\
                                         {f9f7ce}Materiale in casa \t%s\n\
                                         {f9f7ce}Droguri in casa \t%s grame\n\
                                         {f9f7ce}Mobilier casa \t%d/30 obiecte\n\                                  
                                         {f9f7ce}Editeaza mobilier"
,
                                         
HouseInfo[h][hName],renttext,locktext,FormatNumber(HouseInfo[h][hSeif]),FormatNumber(HouseInfo[h][hMats]),FormatNumber(HouseInfo[h][hDrugs]), GetHouseObjects(PlayerInfo[playerid][pHouse]));
        
ShowPlayerDialog(playerid, DIALOG_HM, DIALOG_STYLE_TABLIST, "{02901a}Meniu casa",strong, "Select", "Cancel"); 
and [pHouse] is houseky.
Reply


Messages In This Thread
Help furniture - by HypCosmin - 17.01.2019, 12:40
Re: Help furniture - by HypCosmin - 17.01.2019, 15:25
Re: Help furniture - by Chyakka - 17.01.2019, 15:30
Re: Help furniture - by HypCosmin - 17.01.2019, 15:40
Re: Help furniture - by HypCosmin - 17.01.2019, 17:12
Re: Help furniture - by HypCosmin - 18.01.2019, 10:05

Forum Jump:


Users browsing this thread: 1 Guest(s)