Buy House When Owner is Offline!
#1

any idea about buying house? when the owner of house is not connected! i hope there is something direct to do with user(owner) files.. im using INI
Reply
#2

I'm newbie in scripting but this may help you.... Try making if statement to check that if the house is owned.....then in case IF house is owned make another if statement that is if owner is Online and if owner is NOTonline then players can buy the house... Make these in your buy house command..
Reply
#3

anyone other?
Reply
#4

No one here can help you with any coding unless your provide the right code for your house system.

Let's say you're using HouseInfo[MAX_HOUSES][hInfo]. This would then be an example code.

Код:
CMD:buyhouse(playerid, params[]) {
	new string[128], houseid, name;
	houseid = GetPlayerNearestHouseEntrance(playerid)
	if(houseid == -1) return SendClientMessage(playerid, -1, "You're not near any entrance.");
	if(HouseInfo[houseid][hSale] != 1) return SendClientMessage(playerid, -1, "House is not for sale.");
	if(GetPlayerMoney(playerid) < HouseInfo[houseid][hPrice]) return SendClientMessage(playerid, -1, "You don't have enough money.");
	GetPlayerName(playerid, name, sizeof(name));
	format(HouseInfo[houseid][hOwner], %s, name);
	GivePlayerMoney(playerid, -HouseInfo[houseid][hPrice]);
	SendClientMessage(playerid, -1, "Congratulations on your purchase.");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)