21.04.2018, 18:38
You don't need a function to get the house ID.
i is the house ID.
Put the for loop at the top of your code more or less (you can put a check to see if the players connected and what not before it if you wish)
Just put all of this:
inside the code I gave you above.
Код:
for(new i = 0; i < sizeof(HouseInfo); i++) { if(IsPlayerInRangeOfPoint(playerid,2.0,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ])) { //check to see if house is for sale or not etc... } }
Put the for loop at the top of your code more or less (you can put a check to see if the players connected and what not before it if you wish)
Just put all of this:
Код:
if(money < HouseInfo[i][hPrice]) return SendClientMessage(playerid, RED, "ERROR: You don't have enough money to buy this house"); if(HouseInfo[i][hOwned] == 1) return SendClientMessage(playerid, RED, "ERROR: This house is already owned"); if(pInfo[playerid][OwnHouse] == 1) return SendClientMessage(playerid, RED, "ERROR: You own house already");