Properties Not Placing
#1

Alright, so I have this problem with my custom gamemode. The properties (houses, businesses, government buildings) aren't placing when the gamemode starts. The command to place properties is /place. The way it detects whether to place it is if the file exists (fexist.) As shown here;
pawn Код:
for(new h = 0; h < MAX_HOUSES; h++)
    {
        if(fexist(FilePath(2, h)))
        {
            LoadFile(2, h);
            printf("[DEBUG]: Placing house ID %d", h);
            if(HouseInfo[h][hPlaced]) {
                PlaceBuilding(h, 1);
                printf("[DEBUG]: Placed house ID %d", h);
            }
        }
    }
    for(new b = 0; b < MAX_BUSINESSES; b++)
    {
        if(fexist(FilePath(3, b)))
        {
            LoadFile(3, b);
            printf("[DEBUG]: Placing business ID %d", b);
            if(BusinessInfo[b][bPlaced]) {
                PlaceBuilding(b, 1);
                printf("[DEBUG]: Placed business ID %d", b);
            }
        }
    }
    for(new i = 0; i < 150; i++)
    {
        if(fexist(FilePath(5, i)))
        {
            LoadFile(5, i);
            printf("[DEBUG]: Placing government building ID %d", i);
            if(GovBuildInfo[i][gbPlaced]) {
                printf("[DEBUG]: Placed government building ID %d", i);
                PlaceBuilding(i, 1);
            }
        }
    }
So, my default instinct would be to check if it's saving. I get the debug message saying that it was loaded, but it stops after that. Meaning that somewhere between it loading and sending the debug message that it's being placed something happens. So let's look at LoadFile;

pawn Код:
case 2:
        {
            file_Open(FilePath(2, targetid));
            HouseInfo[targetid][hXYZA_Inside][0] =      file_GetFloat("Inside X");
            HouseInfo[targetid][hXYZA_Inside][1] =      file_GetFloat("Inside Y");
            HouseInfo[targetid][hXYZA_Inside][2] =      file_GetFloat("Inside Z");
            HouseInfo[targetid][hXYZA_Inside][3] =      file_GetFloat("Inside Angle");
            HouseInfo[targetid][hXYZA_Outside][0] =     file_GetFloat("Outside X");
            HouseInfo[targetid][hXYZA_Outside][1] =     file_GetFloat("Outside Y");
            HouseInfo[targetid][hXYZA_Outside][2] =     file_GetFloat("Outside Z");
            HouseInfo[targetid][hXYZA_Outside][3] =     file_GetFloat("Outside Angle");
            file_GetStr("Owner's Name",                 HouseInfo[targetid][hOwner]);
            file_GetStr("Address",                      HouseInfo[targetid][hAddress]);
            HouseInfo[targetid][hVW_Outside] =          file_GetVal("Virtual World Outside");
            HouseInfo[targetid][hVW_Inside] =           file_GetVal("Virtual World Inside");
            HouseInfo[targetid][hInt_Outside] =         file_GetVal("Interior Outside");
            HouseInfo[targetid][hInt_Inside] =          file_GetVal("Interior Inside");
            HouseInfo[targetid][hWeapon][0] =           file_GetVal("Weapon 1");
            HouseInfo[targetid][hWeapon][1] =           file_GetVal("Weapon 2");
            HouseInfo[targetid][hWeapon][2] =           file_GetVal("Weapon 3");
            HouseInfo[targetid][hWeapon][3] =           file_GetVal("Weapon 4");
            HouseInfo[targetid][hWeapon][4] =           file_GetVal("Weapon 5");
            HouseInfo[targetid][hWeapon][5] =           file_GetVal("Weapon 6");
            HouseInfo[targetid][hWeapon][6] =           file_GetVal("Weapon 7");
            HouseInfo[targetid][hWeapon][7] =           file_GetVal("Weapon 8");
            HouseInfo[targetid][hAmmo][0] =             file_GetVal("Ammo 1");
            HouseInfo[targetid][hAmmo][1] =             file_GetVal("Ammo 2");
            HouseInfo[targetid][hAmmo][2] =             file_GetVal("Ammo 3");
            HouseInfo[targetid][hAmmo][3] =             file_GetVal("Ammo 4");
            HouseInfo[targetid][hAmmo][4] =             file_GetVal("Ammo 5");
            HouseInfo[targetid][hAmmo][5] =             file_GetVal("Ammo 6");
            HouseInfo[targetid][hAmmo][6] =             file_GetVal("Ammo 7");
            HouseInfo[targetid][hAmmo][7] =             file_GetVal("Ammo 8");
            for(new i = 0; i < 24; i++)
            {
                format(varstr, 16, "Fridge Slot %d", i);
                HouseInfo[targetid][hFridgeContents][i] = file_GetVal(varstr);
            }
            HouseInfo[targetid][hFridgeContents][0] =   file_GetVal("Fridge Slot 1");
            HouseInfo[targetid][hCloset][0] =           file_GetVal("Closet Slot 1");
            HouseInfo[targetid][hCloset][1] =           file_GetVal("Closet Slot 2");
            HouseInfo[targetid][hCloset][2] =           file_GetVal("Closet Slot 3");
            HouseInfo[targetid][hCloset][3] =           file_GetVal("Closet Slot 4");
            HouseInfo[targetid][hCloset][4] =           file_GetVal("Closet Slot 5");
            HouseInfo[targetid][hCloset][5] =           file_GetVal("Closet Slot 6");
            HouseInfo[targetid][hCloset][6] =           file_GetVal("Closet Slot 7");
            HouseInfo[targetid][hCloset][7] =           file_GetVal("Closet Slot 8");
            HouseInfo[targetid][hCloset][8] =           file_GetVal("Closet Slot 9");
            HouseInfo[targetid][hCloset][9] =           file_GetVal("Closet Slot 10");
            HouseInfo[targetid][hCloset][10] =          file_GetVal("Closet Slot 11");
            HouseInfo[targetid][hCloset][11] =          file_GetVal("Closet Slot 12");
            HouseInfo[targetid][hSafePIN] =             file_GetVal("Safe PIN");
            HouseInfo[targetid][hSafe] =                file_GetVal("Cash in Safe");
            HouseInfo[targetid][hPrice] =               file_GetVal("Price");
            var = file_GetVal("Owned");
            if(var == 1) HouseInfo[targetid][hOwned] = true;
            if(var == 0) HouseInfo[targetid][hOwned] = false;
            var = file_GetVal("Placed");
            if(var == 1) HouseInfo[targetid][hPlaced] = true;
            if(var == 0) HouseInfo[targetid][hPlaced] = false;
            var = file_GetVal("Locked");
            if(var == 1) HouseInfo[targetid][hLocked] = true;
            if(var == 0) HouseInfo[targetid][hLocked] = false;
            file_Close();
            printf("[DEBUG]: House ID %d was loaded properly", targetid);
        }
        case 3:
        {
            file_Open(FilePath(3, targetid));
            BusinessInfo[targetid][bXYZA_Inside][0] =   file_GetFloat("Inside X");
            BusinessInfo[targetid][bXYZA_Inside][1] =   file_GetFloat("Inside Y");
            BusinessInfo[targetid][bXYZA_Inside][2] =   file_GetFloat("Inside Z");
            BusinessInfo[targetid][bXYZA_Inside][3] =   file_GetFloat("Inside Angle");
            BusinessInfo[targetid][bXYZA_Outside][0] =  file_GetFloat("Outside X");
            BusinessInfo[targetid][bXYZA_Outside][1] =  file_GetFloat("Outside Y");
            BusinessInfo[targetid][bXYZA_Outside][2] =  file_GetFloat("Outside Z");
            BusinessInfo[targetid][bXYZA_Outside][3] =  file_GetFloat("Outside Angle");
            BusinessInfo[targetid][bVW_Outside] =       file_GetVal("Virtual World Outside");
            BusinessInfo[targetid][bVW_Inside] =        file_GetVal("Virtual World Inside");
            BusinessInfo[targetid][bInt_Outside] =      file_GetVal("Interior Outside");
            BusinessInfo[targetid][bInt_Inside] =       file_GetVal("Interior Inside");
            BusinessInfo[targetid][bWeapon][0] =        file_GetVal("Weapon 1");
            BusinessInfo[targetid][bWeapon][1] =        file_GetVal("Weapon 2");
            BusinessInfo[targetid][bAmmo][0] =          file_GetVal("Ammo 1");
            BusinessInfo[targetid][bAmmo][1] =          file_GetVal("Ammo 2");
            BusinessInfo[targetid][bSafePIN] =          file_GetVal("Safe PIN");
            BusinessInfo[targetid][bSafe] =             file_GetVal("Cash in Safe");
            BusinessInfo[targetid][bPrice] =            file_GetVal("Price");
            file_GetStr("Owner's Name",                 BusinessInfo[targetid][bOwner]);
            file_GetStr("Address",                      BusinessInfo[targetid][bAddress]);
            file_GetStr("Business Name",                BusinessInfo[targetid][bName]);
            BusinessInfo[targetid][bType] =             file_GetVal("Type of Business");
            var = file_GetVal("Owned");
            if(var == 1) BusinessInfo[targetid][bOwned] = true;
            if(var == 0) BusinessInfo[targetid][bOwned] = false;
            var = file_GetVal("Placed");
            if(var == 1) BusinessInfo[targetid][bPlaced] = true;
            if(var == 0) BusinessInfo[targetid][bPlaced] = false;
            var = file_GetVal("Locked");
            if(var == 1) BusinessInfo[targetid][bLocked] = true;
            if(var == 0) BusinessInfo[targetid][bLocked] = false;
            file_Close();
            printf("[DEBUG]: Business ID %d was loaded properly", targetid);
        }
        case 5:
        {
            file_Open(FilePath(type, targetid));
            GovBuildInfo[targetid][gbInt_Inside] =      file_GetVal("Interior Inside");
            GovBuildInfo[targetid][gbInt_Outside] =     file_GetVal("Interior Outside");
            GovBuildInfo[targetid][gbVW_Inside] =       file_GetVal("Virtual World Inside");
            GovBuildInfo[targetid][gbVW_Outside] =      file_GetVal("Virtual World Outside");
            GovBuildInfo[targetid][gbXYZA_Inside][0] =  file_GetFloat("X Inside");
            GovBuildInfo[targetid][gbXYZA_Inside][1] =  file_GetFloat("Y Inside");
            GovBuildInfo[targetid][gbXYZA_Inside][2] =  file_GetFloat("Z Inside");
            GovBuildInfo[targetid][gbXYZA_Inside][3] =  file_GetFloat("Angle Inside");
            GovBuildInfo[targetid][gbXYZA_Outside][0] = file_GetFloat("X Outside");
            GovBuildInfo[targetid][gbXYZA_Outside][0] = file_GetFloat("Y Outside");
            GovBuildInfo[targetid][gbXYZA_Outside][0] = file_GetFloat("Z Outside");
            GovBuildInfo[targetid][gbXYZA_Outside][0] = file_GetFloat("Angle Outside");
            file_GetStr("Address",                  GovBuildInfo[targetid][gbAddress]);
            file_GetStr("Name",                     GovBuildInfo[targetid][gbName]);
            var = file_GetVal("Placed");
            if(var == 0) GovBuildInfo[targetid][gbPlaced] = false;
            if(var == 1) GovBuildInfo[targetid][gbPlaced] = true;
            file_Close();
            printf("[DEBUG]: Government building ID %d was saved properly", targetid);
        }
This was working previously, and I'm not sure what I could have added to make it stop working. Here's the log.
Код HTML:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3x, ©2005-2013 SA-MP Team

[14:49:25] 
[14:49:25] Server Plugins
[14:49:25] --------------
[14:49:25]  Loading plugin: nativechecker
[14:49:25]   Loaded.
[14:49:25]  Loading plugin: crashdetect
[14:49:25]   CrashDetect v4.10 is OK.
[14:49:25]   Loaded.
[14:49:25]  Loaded 2 plugins.

[14:49:25] 
[14:49:25] Filterscripts
[14:49:25] ---------------
[14:49:25]   Loaded 0 filterscripts.

[14:49:27]  
[14:49:27]  
[14:49:27]  
[14:49:27]  ======================================= 
[14:49:27]  |                                     | 
[14:49:27]  |        YSI version 1.06.0002        | 
[14:49:27]  |        By Alex "******" Cole        | 
[14:49:27]  |                                     | 
[14:49:27]  ======================================= 
[14:49:27]  
[14:49:27]  
[14:49:27]  
[14:49:27]  
[14:49:27] [DEBUG]: 18 classes loaded
[14:49:27] Dillimore County Roleplay |___| By Gavin Baker
[14:49:27] Number of vehicle models: 0
[14:49:27] New version of CrashDetect is available for download (4.10.1)
[14:50:19] Incoming connection: 127.0.0.1:51586
[14:50:19] [join] Ash_Whitlock has joined the server (0:127.0.0.1)
[14:50:19] Ash Whitlock (0) has connected to the server!
[14:50:19] [DEBUG]: Ash Whitlock (0)'s file was loaded properly
[14:50:23] [COMMAND]: Ash Whitlock (0) sent passwordlol
[14:50:27] [COMMAND]: Ash Whitlock (0) sent /register passwordlol
[14:50:27] ERROR CREATING FILE : '/dcrp/accounts/Ash Whitlock.ini' : FILE ALREADY EXISTS
[14:50:44] [DEBUG]: Ash Whitlock's file was saved successfully!
[14:50:47] [COMMAND]: Ash Whitlock (0) sent passwordlol
[14:50:47] [Admin]: Ash Whitlock (0) has logged in!
[14:51:16] RCON (In-Game): Player #0 (Ash_Whitlock) has logged in.
[14:51:19] [COMMAND]: Ash Whitlock (0) sent /setadmin 0 5 .
[14:51:19] [Admin]: Ash Whitlock (0) has given admin level 5 to Ash Whitlock (0) for - .
[14:51:31] [COMMAND]: Ash Whitlock (0) sent /place business
[14:51:31] [DEBUG]: Business ID 0 was saved properly
[14:51:31] [DEBUG]: Business ID 0 was loaded and placed properly. It should display in game
[14:51:57] Ash Whitlock has left the server (/q)
[14:51:57] [DEBUG]: Ash Whitlock's file was saved successfully!
[14:51:57] [part] Ash_Whitlock has left the server (0:1)
Console input: exit
[14:52:10] --- Server Shutting Down.
[14:52:10] [DEBUG]: Business ID 0 was saved properly

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3x, ©2005-2013 SA-MP Team

[14:52:13] 
[14:52:13] Server Plugins
[14:52:13] --------------
[14:52:13]  Loading plugin: nativechecker
[14:52:13]   Loaded.
[14:52:13]  Loading plugin: crashdetect
[14:52:13]   CrashDetect v4.10 is OK.
[14:52:13]   Loaded.
[14:52:13]  Loaded 2 plugins.

[14:52:13] 
[14:52:13] Filterscripts
[14:52:13] ---------------
[14:52:13]   Loaded 0 filterscripts.

[14:52:13]  
[14:52:13]  
[14:52:13]  
[14:52:13]  ======================================= 
[14:52:13]  |                                     | 
[14:52:13]  |        YSI version 1.06.0002        | 
[14:52:13]  |        By Alex "******" Cole        | 
[14:52:13]  |                                     | 
[14:52:13]  ======================================= 
[14:52:13]  
[14:52:13]  
[14:52:13]  
[14:52:13]  
[14:52:13] [DEBUG]: 18 classes loaded
[14:52:13] [DEBUG]: Business ID 0 was loaded properly
[14:52:13] [DEBUG]: Placing business ID 0
[14:52:13] [DEBUG]: There was an error placing building ID 0 with type 2 - File does not exist.
[14:52:13] [DEBUG]: Placed business ID 0
[14:52:13] Dillimore County Roleplay |___| By Gavin Baker
[14:52:13] Number of vehicle models: 0
[14:52:13] New version of CrashDetect is available for download (4.10.1)
Console input: exit
[14:53:15] --- Server Shutting Down.
[14:53:15] [DEBUG]: Business ID 0 was saved properly
All the integers for all the functions are correct, so I'm clueless as to what the problem is. Any help would be appreciated.
Reply
#2

Bump? Some help here would be awesome :P
Reply
#3

Bumpty bump again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)