String duplicating inside of dialog.
#1

Edited: Irrelevant and no use to anyone. Current problem is on second page.
Reply
#2

I have the same problem in my land system, When I edit an object it becomes duplicate. and i still can`t finding the problem seems yours.
Reply
#3

Why don't you format a string and use strcat after formatting it? Like this example:
PHP Code:
CMD:interiorlist(playerid)
{
    if(!
IsPlayerAdmin(playerid))
        return 
0;
    new 
sub_str[100],
        
principal_str[250];
    foreach(new 
It_Interior)
    {
        
format(sub_strsizeof(sub_str), "ID: %i » %s\n"iBizInterior[i][i_Name]);
        
strcat(principal_strsub_str);
    }
    
Dialog_Show(playeridNOTHINGDIALOG_STYLE_MSGBOX"All custom interiors"principal_str"Ok""");
    return 
1;

Reply
#4

Didn't work Dayrion. Still doesn't explain why CountPropertyFurniture is returning a 28.

(How this post get 14,000 views?)
Reply
#5

Quote:
Originally Posted by Arthur Kane
View Post
(How this post get 14,000 views?)
All the rep hunters coming in thinking this is an easy duplication of tags in the string formulation.
Reply
#6

Fixed the issue. Was actually an unrelated problem that caused objects to duplicate...
Reply
#7

Might as well post it here. I'm having a problem with objects with this furniture system not being created.

It creates like 2 restarts later then doesn't.

PHP Code:
Server:SQL_LoadFurniture()
{
    new 
rowsfieldscount 0
    
    
cache_get_data(rowsfieldsm_Handle);
    
    if(
rows){
        for(new 
0rows && MAX_FURNITUREi++){
        
            
FurnitureData[i+1][furnitureSQLID] = cache_get_field_content_int(i"id"m_Handle);
                       
                        ...        
     
            
FurnitureData[i+1][furnitureObject] = CreateDynamicObject(FurnitureData[i+1][furnituresModel], FurnitureData[i+1][furniturePos][0], FurnitureData[i+1][furniturePos][1], FurnitureData[i+1][furniturePos][2], FurnitureData[i+1][furnitureRot][0], 
                
FurnitureData[i+1][furnitureRot][1], FurnitureData[i+1][furnitureRot][2], PropertyData[FurnitureData[i+1][furniturePropertyID]][propertyInteriorWorld], PropertyData[FurnitureData[i+1][furniturePropertyID]][propertyInteriorID]);            
            
        }
    }
    return 
true;

Reply
#8

Bump.
Reply
#9

If it creates 2-3 times and doesn't create it later (rip english, apologize), the problem should come from your save system.
Also, this is bad practice, I guess, to make addition in array.
PHP Code:
Server:SQL_LoadFurniture() 

    new 
rowsfieldscount 0;  
     
    
cache_get_data(rowsfieldsm_Handle); 
     
    if(
rows){ 
        for(new 
i1rows && MAX_FURNITUREi++, j++){ 
         
            
FurnitureData[j][furnitureSQLID] = cache_get_field_content_int(i"id"m_Handle); 
                        
                        ...         
      
            
FurnitureData[j][furnitureObject] = CreateDynamicObject(FurnitureData[j][furnituresModel], FurnitureData[j][furniturePos][0], FurnitureData[j][furniturePos][1], FurnitureData[j][furniturePos][2], FurnitureData[j][furnitureRot][0],  
                
FurnitureData[j][furnitureRot][1], FurnitureData[j][furnitureRot][2], PropertyData[FurnitureData[j][furniturePropertyID]][propertyInteriorWorld], PropertyData[FurnitureData[j][furniturePropertyID]][propertyInteriorID]);             
             
        } 
    } 
    return 
true

Reply
#10

Thanks for the help but the problem still continues to exist.

The objects are created by:
PHP Code:
FurnitureData[j][furnitureObject] = CreateDynamicObject(FurnitureData[j][furnituresModel], FurnitureData[j][furniturePos][0], FurnitureData[j][furniturePos][1], FurnitureData[j][furniturePos][2], FurnitureData[j][furnitureRot][0], 
                
FurnitureData[j][furnitureRot][1], FurnitureData[j][furnitureRot][2], PropertyData[FurnitureData[j][furniturePropertyID]][propertyInteriorWorld], PropertyData[FurnitureData[j][furniturePropertyID]][propertyInteriorID]); 
Let me be clearer.

I GMX the server, it creates. I GMX it the second time. It creates. Third time, it doesn't create. And so on, and so on. It happens randomly and I don't know why.

EVERYTHING loads but the object does NOT create.
Reply
#11

Which version from this thread of the Server:SQL_LoadFurniture()*function are you using?
Reply
#12

This is the full code:
PHP Code:
-- 
Reply
#13

Not familiar with the sql plugin, but it would make sense the row ids would start at 0. So try settingn i and j equal to zero first. This will also effect your array as you're currently not using the 0 slot.

You also use cache_get_field content with j as reference near the bottom. That could be the issue?
Reply
#14

That's mySQL and I'll try that.

And yeah, that probably is the issue for the name being NULL. Like I said, everything loads BUT the object sometimes. The data is read and loaded but the object doesn't get created. No clue why.
Reply
#15

Results are same.

Like I said, the DATA loads but the object wants to be random. Loads this time, doesn't load the other time. And on and on and on.

What could even be causing this? No clue on how it's happening.

EDIT:

The only possible thing I could think of is,

since it fetches the world and interior to be made in from the property and it's possible the property doesn't load in time somehow and the object is created in void?

PHP Code:
PropertyData[FurnitureData[j][furniturePropertyID]][propertyInteriorWorld], 
PropertyData[FurnitureData[j][furniturePropertyID]][propertyInteriorID
Reply
#16

Yep, that's the issue...

Would it be a bad idea to set a timer on loading furnitures?

I have roughly 500 + properties and it takes each at least 20 ms to load.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)