23.08.2012, 00:41
What am I doing wrong? The print won't show up, so I assume it's something to do with my ParseFile.
My house enum:
OnGameModeInit:
LoadHouses:
FindHouseFile & FindOpenHouseID
Loading everything:
My house enum:
pawn Код:
enum hVars {
EnterInteriorID, // The interior they are teleported to!
Float: EnterInteriorPosition [ 3 ], // Where they get teleported to when they enter the house!
EnterVirtualWorldID,
Float: ExitExteriorPosition [ 4 ], // Where they get teleported to when they exit the house! (also where they enter)
ExitInteriorID,
ExitVirtualWorldID,
IsLocked,
HouseOwner [ MAX_PLAYER_NAME ]
};
new
houStats [ MAX_HOUSES ] [ hVars ],
bool: houCreated [ MAX_HOUSES ] = false,
houID [ MAX_HOUSES ] = -1;
pawn Код:
LoadHouses ( );
pawn Код:
stock LoadHouses ( )
{
for( new h; h < MAX_HOUSES; h ++ )
{
if( fexist( FindHouseFile( h ) ) ) // The house exists in the directory!
{
INI_ParseFile( FindHouseFile( h ), "LoadHouse_%s", .bExtra = true, .extra = h );
}
}
return true;
}
pawn Код:
stock FindHouseFile ( houseid )
{
new
houStr [ 128 ];
format( houStr, sizeof houStr, DIRECTORY_HOUSES, houseid );
return houStr;
}
stock FindOpenHouseID ( )
{
new
hID = -1;
for( new h; h < MAX_HOUSES; h ++ )
{
if( !fexist( FindHouseFile( h ) ) )
{
return hID = h;
}
}
return hID;
}
pawn Код:
forward LoadHouse_data ( houseid, name[], value[] );
public LoadHouse_data ( houseid, name[], value[] )
{
INI_Int( "EnterInteriorID", houStats [ houseid ] [ EnterInteriorID ] );
INI_Int( "EnterVirtualWorldID", houStats [ houseid ] [ EnterVirtualWorldID ] );
INI_Float( "EnterInteriorPosition_X", houStats [ houseid ] [ EnterInteriorPosition ] [ 0 ] );
INI_Float( "EnterInteriorPosition_Y", houStats [ houseid ] [ EnterInteriorPosition ] [ 1 ] );
INI_Float( "EnterInteriorPosition_Z", houStats [ houseid ] [ EnterInteriorPosition ] [ 2 ] );
INI_Int( "ExitInteriorID", houStats [ houseid ] [ ExitInteriorID ] );
INI_Int( "ExitVirtualWorldID", houStats [ houseid ] [ ExitVirtualWorldID ] );
INI_Float( "ExitExteriorPosition_X", houStats [ houseid ] [ ExitExteriorPosition ] [ 0 ] );
INI_Float( "ExitExteriorPosition_Y", houStats [ houseid ] [ ExitExteriorPosition ] [ 1 ] );
INI_Float( "ExitExteriorPosition_Z", houStats [ houseid ] [ ExitExteriorPosition ] [ 2 ] );
INI_Int( "IsLocked", houStats [ houseid ] [ IsLocked ] );
INI_String( "HouseOwner", houStats [ houseid ] [ HouseOwner ], MAX_PLAYER_NAME );
houID [ houseid ] = houseid;
houCreated [ houseid ] = true;
printf("ID: %d, VW: %d", houID [ houseid ], houStats [ houseid ] [ EnterVirtualWorldID ] ); // This won't show up.
return true;
}