OnGameModeInit()
{
new string[40];
for(new idx = 0; idx < sizeof(HInfo); idx++)
{
format(string, sizeof(string),HOUSE_PATH, idx);
INI_ParseFile(string, "LoadHouses_%d", .bExtra = true, .extra = idx );
new labelstring[100];
switch(HInfo[idx][Owned])
{
case 0:{format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HInfo[idx][Price]);}
case 1:{format(labelstring,sizeof(labelstring),"Owned: Yes \n Owner: %s",HInfo[idx][Owner]);}
}
HInfo[idx][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,HInfo[idx][XPos],HInfo[idx][YPos],HInfo[idx][ZPos],25.0,HInfo[idx][VirtualWorld]);
}
}
public LoadHouses(idx, name[], value[])
{
INI_Float("XPos",HInfo[idx][XPos]);
INI_Float("YPos",HInfo[idx][YPos]);
INI_Float("ZPos",HInfo[idx][ZPos]);
INI_Int("Owned",HInfo[idx][Owned]);
INI_Int("Price",HInfo[idx][Price]);
INI_String("Owner",HInfo[idx][Owner],25);
INI_Int("VirutalWorld",HInfo[idx][VirtualWorld]);
return 1;
}
INI_ParseFile(string, "LoadHouses_%d", .bExtra = true, .extra = idx );
INI_ParseFile(string, "LoadHouses", .bExtra = true, .extra = idx, .bPassTag = true);
public OnGameModeInit()
{
new string[40];
for(new idx = 0; idx < sizeof(HInfo); idx++)
{
format(string, sizeof(string), HOUSE_PATH, idx);
if(!fexist(string)) continue;
INI_ParseFile(string, "LoadHouses", .bExtra = true, .extra = idx, .bPassTag = true);
new labelstring[50];
if(!HInfo[idx][Owned]) format(labelstring, sizeof(labelstring), "Owned: No \nPrice: %i", HInfo[idx][Price]);
else format(labelstring, sizeof(labelstring), "Owned: Yes \n Owner: %s", HInfo[idx][Owner]);
HInfo[idx][HouseLabel] = Create3DTextLabel(labelstring, 0xFF0000FF, HInfo[idx][XPos], HInfo[idx][YPos], HInfo[idx][ZPos], 25.0, HInfo[idx][VirtualWorld]);
}
return 1;
}
INI_ParseFile(string, "LoadHouses_%s", .bExtra = true, .extra = idx); public LoadHouses_data(idx, name[], value[]) |
public SaveHouse(id)
{
new file4[40];
format(file4, sizeof(file4),HOUSE_PATH, id);
new INI:File = INI_Open(file4);
INI_WriteInt(File,"Owned",HInfo[id][Owned]);
INI_WriteInt(File,"Price",HInfo[id][Price]);
INI_WriteString(File,"Owner",HInfo[id][Owner]);
INI_WriteFloat(File,"XPos",HInfo[id][XPos]);
INI_WriteFloat(File,"YPos", HInfo[id][YPos]);
INI_WriteFloat(File,"ZPos",HInfo[id][ZPos]);
INI_Close(File);
return 1;
}