23.11.2016, 15:23
Help help. Guyz i got System house but I Need help When i pressing /createhouse its worked and Everything are good but when i try to buy it Nothing happend Why? Any help Plesae?
This code when a player need buy the house... and its not worked.
NOTE: I Got a errros for a y_hooks.inc include Did this will be happend to System?
This code when a player need buy the house... and its not worked.
Код:
//------------------------------------------------------------------------------ // House Buying //------------------------------------------------------------------------------ if(dialogid == HOUSEMENU+4) { if(response) { new hname[MAX_PLAYER_NAME+9]; if(GetOwnedHouses(playerid) >= MAX_HOUSES_OWNED) { ShowInfoBox(playerid, E_MAX_HOUSES_OWNED, MAX_HOUSES_OWNED, AddS(MAX_HOUSES_OWNED)); return 1; } if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_H_ALREADY_OWNED); if(hInfo[h][HouseValue] > GetPlayerMoney(playerid)) { ShowInfoBox(playerid, E_CANT_AFFORD_HOUSE, hInfo[h][HouseValue], GetPlayerMoney(playerid), (hInfo[h][HouseValue] - GetPlayerMoney(playerid))); return 1; } else { format(hname, sizeof(hname), "%s's House", pNick(playerid)); format(hInfo[h][HouseName], sizeof(hname), "%s", hname); format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", pNick(playerid)); hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD"); hInfo[h][HouseStorage] = 0; GivePlayerMoney(playerid, -hInfo[h][HouseValue]); file = INI_Open(filename); INI_WriteString(file, "HouseOwner", pNick(playerid)); INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]); INI_WriteString(file, "HouseName", hname); INI_WriteInt(file, "HouseStorage", 0); INI_Close(file); ShowInfoBox(playerid, I_BUY_HOUSE, hInfo[h][HouseValue]); foreach(Houses, h2) { if(IsHouseInRangeOfHouse(h, h2, RANGE_BETWEEN_HOUSES) && h2 != h) { file = INI_Open(HouseFile(h2)); INI_WriteInt(file, "HouseValue", (hInfo[h2][HouseValue] + ReturnProcent(hInfo[h2][HouseValue], HOUSE_SELLING_PROCENT2))); UpdateHouseText(h2); INI_Close(file); } } #if GH_USE_MAPICONS == false DestroyDynamicMapIcon(HouseMIcon[h]); HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 32, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD); #endif UpdateHouseText(h); } } return 1; }