One House Per Player
#1

Can anyone help me

I want to make just one house per player. In my server player buy a house as they can so i want one house per player anyone can help me?

Код:
enum hInfo
{
	Owner[MAX_PLAYER_NAME],
	Price,
	Interior,
	Exterior,
	VirtualWorld, // Useful for making 2 houses with the same interior
	Locked,
	Float:InteriorX,
	Float:InteriorY,
	Float:InteriorZ,
	Float:ExteriorX,
	Float:ExteriorY,
	Float:ExteriorZ,
	// Storage
	Money,
	Weapon[13],
	Ammo[13],
	// Furniture
	FCount,
	FModel[MAX_FURNITURE],
	FurnitureObj[MAX_FURNITURE],
	Float:FPosX[MAX_FURNITURE],
	Float:FPosY[MAX_FURNITURE],
	Float:FPosZ[MAX_FURNITURE],
	Float:FRotX[MAX_FURNITURE],
	Float:FRotY[MAX_FURNITURE],
	Float:FRotZ[MAX_FURNITURE]
};
Код:
stock BuyHouse(playerid, houseid)
{
	new string[64];
	new name[24];
	GetPlayerName(playerid, name, 24);
	GivePlayerMoney(playerid, -HouseInfo[houseid][Price]);
	format(HouseInfo[houseid][Owner], 24, name);
	HouseInfo[houseid][Locked] = 0;
	format(string, 64, HOUSE_FILE, houseid);
	INI_Open(string);
	INI_WriteString("Owner", HouseInfo[houseid][Owner]);
	INI_WriteInt("Locked", HouseInfo[houseid][Locked]);
	INI_Save();
	INI_Close();

	DestroyDynamicPickup(HousePickup[houseid]);
	HousePickup[houseid] = CreateDynamicPickup(19522, 23, HouseInfo[houseid][ExteriorX], HouseInfo[houseid][ExteriorY], HouseInfo[houseid][ExteriorZ]);
	#if MAP_ICONS == 1
	DestroyDynamicMapIcon(HouseIcon[houseid]);
	HouseIcon[houseid] = CreateDynamicMapIcon(HouseInfo[houseid][ExteriorX], HouseInfo[houseid][ExteriorY], HouseInfo[houseid][ExteriorZ], 32, 0, _, _, _, 800.0);
	#endif

	#if CONSOLE == 1
	printf("Player %s(%d) bought house ID %d.", name, playerid, houseid);
	#endif
	FS_MsgBox(playerid, "{33AA33}ACTION", "You bought this house.");
	return 1;
}
Anyone :3
Reply


Messages In This Thread
One House Per Player - by CrazyPerry - 14.12.2015, 09:18
Re: One House Per Player - by Nero_3D - 14.12.2015, 10:54
Re: One House Per Player - by sidney123 - 14.12.2015, 10:54
Re: One House Per Player - by CrazyPerry - 14.12.2015, 21:15

Forum Jump:


Users browsing this thread: 1 Guest(s)