House System
#2

You don't need a function to get the house ID.

Код:
        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...
                 }
        }
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:

Код:
        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");
inside the code I gave you above.
Reply


Messages In This Thread
House System - by Oshery - 21.04.2018, 08:50
Re: House System - by ItsRobinson - 21.04.2018, 18:38

Forum Jump:


Users browsing this thread: 1 Guest(s)