SA-MP Forums Archive
OnGameModeInit isn't finished - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnGameModeInit isn't finished (/showthread.php?tid=451508)



OnGameModeInit isn't finished - Mado - 17.07.2013

Hi,

If I launch the gamemode I get stuck at "Joining the game" when joining.

I put some prints around the newly added functions and it seems the problem is at LoadHouses. The code is below:

pawn Код:
public OnGameModeInit()
{
    LoadHouses();
    return 1;
}
pawn Код:
stock LoadHouses()
{
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        new path[20];
        format(path, sizeof(path), "Houses/%d.ini", i);
        if(dini_Exists(path))
        {
            LoadHouse(i);
            SpawnedHouses += 1;
        }
    }
    return 1;
}
pawn Код:
LoadHouse(houseid)
{
    new path[20];
    format(path, sizeof(path), "Houses/%d.ini", houseid);
    if(dini_Exists(path))
    {
        HouseInfo[houseid][EntranceX] = dini_Float(path, "EntranceX");
        HouseInfo[houseid][EntranceY] = dini_Float(path, "EntranceY");
        HouseInfo[houseid][EntranceZ] = dini_Float(path, "EntranceZ");
        HouseInfo[houseid][InsideX] = dini_Float(path, "InsideX");
        HouseInfo[houseid][InsideY] = dini_Float(path, "InsideY");
        HouseInfo[houseid][InsideZ] = dini_Float(path, "InsideZ");
        HouseInfo[houseid][InsideInt] = dini_Int(path, "InsideInt");
        HouseInfo[houseid][Owned] = dini_Int(path, "Owned");
        HouseInfo[houseid][Owner] = dini_Get(path, "Owner");
        strmid(HouseInfo[houseid][Owner], dini_Get(path, "Owner"), 0, false, strlen(dini_Get("Owner")));
        HouseInfo[houseid][Price] = dini_Int(path, "Price");
        HouseInfo[houseid][AlarmInstalled] = dini_Int(path, "AlarmInstalled");
        HouseInfo[houseid][Locked] = dini_Int(path, "Locked");
        HouseInfo[houseid][DoorRammed] = dini_Int(path, "DoorRammed");
        HouseInfo[houseid][CustomInt] = dini_Int(path, "CustomInt");
        HouseInfo[houseid][CustomExt] = dini_Int(path, "CustomExt");
        HouseInfo[houseid][PickupID] = dini_Int(path, "PickupID");
        UpdateHouse(houseid);
    }
    return 0;
}



Re: OnGameModeInit isn't finished - Mystique - 17.07.2013

Are you sure that the "houses" folder is in the scriptfiles directory?


Re: OnGameModeInit isn't finished - Mado - 17.07.2013

Yes I am.