I dont know what's wrong with it, but everything I do contains with it more bugs.
Код:
stock InitHouses()
{
new FileName[128];
new labelString[96];
for(new h = 0; h < sizeof(Houses); h++)
{
format(FileName, sizeof(FileName), "Houses/House_%d.ini", h);
if(fexist(FileName))
{
Houses[h][hInteriorID] = dini_Int(FileName, "InteriorID");
Houses[h][hInteriorX] = dini_Float(FileName, "InteriorX");
Houses[h][hInteriorY] = dini_Float(FileName, "InteriorY");
Houses[h][hInteriorZ] = dini_Float(FileName, "InteriorZ");
Houses[h][HousePrice] = dini_Int(FileName, "HousePrice");
Houses[h][hExteriorID] = dini_Int(FileName, "ExteriorID");
Houses[h][hExteriorX] = dini_Float(FileName, "ExteriorX");
Houses[h][hExteriorY] = dini_Float(FileName, "ExteriorY");
Houses[h][hExteriorZ] = dini_Float(FileName, "ExteriorZ");
Houses[h][VaultMoney] = dini_Int(FileName, "VaultMoney");
Houses[h][HouseCocaine] = dini_Int(FileName, "HouseCocaine");
Houses[h][HousePot] = dini_Int(FileName, "HousePot");
Houses[h][HouseMaterials] = dini_Int(FileName, "HouseMaterials");
Houses[h][hOwner] = dini_Get(FileName, "Owner");
Houses[h][LockStatus] = dini_Int(FileName, "LockStatus");
Houses[h][WeaponSlot1] = dini_Int(FileName, "WeaponSlot1");
Houses[h][WeaponSlot2] = dini_Int(FileName, "WeaponSlot2");
Houses[h][WeaponSlot3] = dini_Int(FileName, "WeaponSlot3");
new NewHouseID = SpawnedHouses+1;
if(strcmp(Houses[h][hOwner], "Nobody", true) == 0)
{
format(labelString, sizeof(labelString), "House %d\n Price: %d",NewHouseID, h);
CreateDynamic3DTextLabel(labelString, ADMIN_GREEN, Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
}
else
{
format(labelString, sizeof(labelString), "House %d",NewHouseID);
Create3DTextLabel(labelString,RED,Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
}
printf("[system] House %d spawned.", h);
SpawnedHouses++;
}
}
}
return 1;
}
You would appear to have too many closing brackets, use proper indentation and it will be more obvious in future! The bracket before return 1; is the last closing bracket required to finish that function.
Ho! so redicolous.