Originally Posted by DaRkM
pawn Код:
for(new h = 1; h < sizeof(HouseInfo); h++) { format(file, sizeof(file), "RRP/houses/%d.ini", h); if(fexist(file)) { if(HouseInfo[h][Owner] == 0) { new string[128]; housepickup[h] = CreatePickup(1273, 1, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 0); format(string, sizeof(string), "This house is for sale. Use /buyhouse to buy it. Price: %d", HouseInfo[h][Price]); housetext[h] = Create3DTextLabel(string, COLOR_RED, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 10.0, 0); } else { new string[128]; housepickup[h] = CreatePickup(1273, 1, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 0); format(string, sizeof(string), "This house is owned by %s.", HouseInfo[h][Owner]); housetext[h] = Create3DTextLabel(string, COLOR_RED, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 10.0, 0); } } } return 1;
pawn Код:
//LoadHouses forward LoadHouses(); public LoadHouses() { for(new i = 1; i < sizeof(HouseInfo); i++) { format(file, sizeof(file), "RRP/houses/%d.ini", i); if(fexist(file)) { HouseInfo[i][X] = dini_Int(file, "X"); HouseInfo[i][Y] = dini_Int(file, "Y"); HouseInfo[i][Z] = dini_Int(file, "Z"); HouseInfo[i][Int] = dini_Int(file, "Int"); HouseInfo[i][Vw] = dini_Int(file, "Vw"); HouseInfo[i][Owner] = dini_Int(file, "Owner"); HouseInfo[i][Lock] = dini_Int(file, "Lock"); HouseInfo[i][Price] = dini_Int(file, "Price"); } } print("[RRP]: Houses Loadeds"); return 1; }
|