Houses won't save, wtf!? [+Rep]
#1

'Sup y'all?

This problem bothers me since a long-ass time! I'm using GarHouse version 2.0, and I'm creating a house with it normally! Okay, until there, everything is pretty nice! When I restart my server with the command "GMX", the houses will save and it's still okay! Everything's still pretty nice! BUT, when I close my server (closing the console) and then opening it again (and enter my server again), I can't see any houses on the map! WTF? What may this cause?
Reply
#2

Maybe your OnGameModeExit callback is not called when you close the console ? I assume you save the houses in that callback.
Reply
#3

That's the one of my gamemode:

pawn Код:
public OnGameModeExit()
    {
        return 1;
    }
Totally new! In GarHouse, the callback doesn't exist since it isn't used!
Reply
#4

Oh yea ... Completely forgot you're using a filterscript. Well, check out the OnFilterScriptExit callback. Maybe when you close the console, the filterscript exit callback is not called? Try to print some debugs in the console and check server logs, see if the callback is called when you restart the server and when you close the console.
Reply
#5

That's the "OnFilterScriptExit", it unloads the cars and houses, but why?

pawn Код:
public OnFilterScriptExit()
{
    new INI:file, lasthcp;
    foreach(Player, i)
    {
        EndHouseRobbery(i);
        SetPVarInt(i, "IsRobbingHouse", 0);
        lasthcp = GetPVarInt(i, "LastHouseCP");
        if(!strcmp(hInfo[lasthcp][HouseOwner], pNick(i), CASE_SENSETIVE) && IsInHouse{i} == 1 && fexist(HouseFile(lasthcp)))
        {
            file = INI_Open(HouseFile(lasthcp));
            INI_WriteInt(file, "QuitInHouse", 1);
            INI_Close(file);
            #if GH_HOUSECARS == true
                SaveHouseCar(lasthcp);
            #endif
        }
        ExitHouse(i, lasthcp);
        DeletePVars(i);
    }
    UnloadHouses(); // Unload houses (also unloads the house cars)
    print("\n>> GarHouse v2.0 By [03]Garsino Unloaded <<\n");
    return 1;
}
Reply
#6

Does anyone knows what I may be able to do / remove in the callback?
Reply
#7

Hmm, guys, I seriously hate bumping, but this isn't normal! :/
Reply
#8

Does anyone have an idea?
Reply
#9

Let's bump this...
Reply
#10

OnGameModeExit is not called when server crashes or you press "X", it's only called when you type "exit" in console.

That filterscripts is unloading everything from it because it loads these things again at OnFilterScriptInit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)