Objects Not Loading!
#1

Hey guys. I'm having a small problem with my furniture system that I'm working on. Basically I made the loading/saving system and also the furniture command which adds a furniture that you can edit. It saves the file and all the variables are correct and it also loads all the files. However, it does not add the object to the server. There is no object there when I log in. I need some help.

LOADING CODE:

pawn Код:
new furniturestring[256];
    for(new ida = 1; ida < sizeof(FurnitureInfo); ida++)
    {
        format(furniturestring, sizeof(furniturestring), FURNITUREPATH, ida);
        INI_ParseFile(furniturestring, "loadfurniture_%s", .bExtra = true, .extra = ida );
    }
   
    new fcount;
    for(new i= 0; i < MAX_FURNITURE; i++)
    {
        if(FurnitureInfo[i][furnitureID] != 0) fcount++;
       
        FurnitureInfo[i][furnitureID] = CreateDynamicObject(FurnitureInfo[i][furnitureModel], FurnitureInfo[i][furnitureX], FurnitureInfo[i][furnitureY], FurnitureInfo[i][furnitureZ], FurnitureInfo[i][furniturerX], FurnitureInfo[i][furniturerY], FurnitureInfo[i][furniturerZ], FurnitureInfo[i][furnitureWorld], FurnitureInfo[i][furnitureInt], -1, 200.0, 0.0);
    }
    printf("  Loaded %d furnitures.", fcount);
Reply
#2

is it under OnGamemodeInit and did u try that it really loads variables correctly because mostly its the problem of loading...
Reply
#3

It is under OnGameModeInit.

It should be loading the variables.

pawn Код:
public loadfurniture_data(ida, name[], value[])
{
    INI_Int("Model", FurnitureInfo[ida][furnitureModel]);
    INI_Int("ID", FurnitureInfo[ida][furnitureID]);
    INI_Int("Int", FurnitureInfo[ida][furnitureInt]);
    INI_Int("World", FurnitureInfo[ida][furnitureWorld]);
    INI_Float("X", FurnitureInfo[ida][furnitureX]);
    INI_Float("Y", FurnitureInfo[ida][furnitureY]);
    INI_Float("Z", FurnitureInfo[ida][furnitureZ]);
    INI_Float("rX", FurnitureInfo[ida][furniturerX]);
    INI_Float("rY", FurnitureInfo[ida][furniturerY]);
    INI_Float("rZ", FurnitureInfo[ida][furniturerZ]);
    return 1;
}
Reply
#4

i mean try printing the result that it loads or not
Reply
#5

Alright I debugged it and the first code did not load the variables correctly. HOWEVER this code does but it still does not create the objects.

pawn Код:
new fcount;
    for(new i = 1; i < sizeof(FurnitureInfo); i++)
    {
        if(FurnitureInfo[i][furnitureID] != 0) fcount++;
       
        FurnitureInfo[i][furnitureID] = CreateDynamicObject(FurnitureInfo[i][furnitureModel], FurnitureInfo[i][furnitureX], FurnitureInfo[i][furnitureY], FurnitureInfo[i][furnitureZ], FurnitureInfo[i][furniturerX], FurnitureInfo[i][furniturerY], FurnitureInfo[i][furniturerZ], FurnitureInfo[i][furnitureWorld], FurnitureInfo[i][furnitureInt], -1, 200.0, 0.0);
    }
    printf("  Loaded %d furnitures.", fcount);
Reply
#6

I checked the debug and I noticed that it doesn't load the interior. It saves the interior correctly but it doesn't load it.. Ideas?

pawn Код:
public loadfurniture_data(ida, name[], value[])
{
    INI_Int("Model", FurnitureInfo[ida][furnitureModel]);
    INI_Int("ID", FurnitureInfo[ida][furnitureID]);
    INI_Int("Interior", FurnitureInfo[ida][furnitureInt]);
    INI_Int("World", FurnitureInfo[ida][furnitureWorld]);
    INI_Float("X", FurnitureInfo[ida][furnitureX]);
    INI_Float("Y", FurnitureInfo[ida][furnitureY]);
    INI_Float("Z", FurnitureInfo[ida][furnitureZ]);
    INI_Float("rX", FurnitureInfo[ida][furniturerX]);
    INI_Float("rY", FurnitureInfo[ida][furniturerY]);
    INI_Float("rZ", FurnitureInfo[ida][furniturerZ]);
    return 1;
}
Reply
#7

It got fixed when I put everything in the same loop. Solved.
Reply
#8

Great sorry i didn't saw the reply i was kinda busy helping other place
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)