Server exports

GetPropertyData

exports["rtx_housing"]:GetPropertyData(propertyId)

Returns stored data for a specific property.

Parameters:

  • propertyId (number)

Returns:

  • nil if property does not exist

  • property data (table)

chevron-rightExamplehashtag
local propertydata = exports["rtx_housing"]:GetPropertyData(1234)

--[[ returned example property table
{
	"houseid": "896541738",
	"propertytype": "MLO",
	"playersinside": [],
	"permissions": [],
	"rented": false,
	"propertyname": "Michael House",
	"storage": {
		"slots": 40,
		"enabled": true,
		"weight": 100000,
		"coords": {
			"x": -804.9462890625,
			"y": 177.37986755371094,
			"z": 72.33470916748047
		}
	},
	"purchasable": true,
	"ownername": "Nina Rose",
	"owned": true,
	"robbery": {
		"sides": {
			"outside": {
				"robbedtime": 0,
				"itemsrobbed": 0
			},
			"inside": {
				"robbedtime": 0,
				"itemsrobbed": 0
			}
		}
	},
	"showblip": true,
	"furniture": {
		"outside": true,
		"inside": true
	},
	"services": {
		"water": {
			"unit": "L",
			"connected": true,
			"consumptionunpaid": 1210.35,
			"consumption": 1210.35,
			"ratePerUnit": 1
		},
		"internet": {
			"unit": "GB",
			"connected": true,
			"consumptionunpaid": 668.6,
			"consumption": 668.6,
			"ratePerUnit": 1
		},
		"electricity": {
			"unit": "kWh",
			"connected": true,
			"consumptionunpaid": 1210.35,
			"consumption": 1210.35,
			"ratePerUnit": 1
		}
	},
	"starter": false,
	"garage": {
		"enabled": true,
		"heading": 114.8031005859375,
		"coords": {
			"x": -819.61328125,
			"y": 183.85594177246094,
			"z": 71.63158416748047
		}
	},	
	"bills": {
		"rent": {
			"name": "Rent",
			"paid": true,
			"amount": 0,
			"id": "rent"
		},
		"electricity": {
			"name": "Electricity",
			"paid": false,
			"amount": 1210,
			"id": "electricity"
		},
		"water": {
			"name": "Water",
			"paid": false,
			"amount": 1210,
			"id": "water"
		},
		"tax": {
			"name": "Property Tax",
			"paid": true,
			"amount": 0,
			"id": "tax"
		},
		"internet": {
			"name": "Internet",
			"paid": false,
			"amount": 669,
			"id": "internet"
		}
	},
	"purchaseprice": 100000,	
	"propertyzone": {
		"polyzonedata": [
			{
				"y": 142.31732177734375,
				"x": -852.1173706054688,
				"z": 61.90737152099609
			},
			{
				"y": 197.09873962402344,
				"x": -847.2413330078125,
				"z": 61.90737152099609
			},
			{
				"y": 195.58143615722656,
				"x": -809.3279418945312,
				"z": 61.90737152099609
			},
			{
				"y": 192.84512329101565,
				"x": -769.3997192382812,
				"z": 61.90737152099609
			},
			{
				"y": 139.9799957275391,
				"x": -763.552978515625,
				"z": 61.90737152099609
			},
			{
				"y": 139.70315551757812,
				"x": -806.7664794921875,
				"z": 61.90737152099609
			}
		],
		"minz": 47.90737152099609,
		"maxz": 87.9073715209961
	},
	"settings": {
		"clean": 0,
		"doorbellid": "1"
	},
	"owner": "char1:59cda6cea2cba2d00a2866476b76a12cf58be27a",
	"doors": {
		"472179357": {
			"door1": {
				"coords": {
					"y": 176.17552185058597,
					"x": -802.70166015625,
					"z": 76.89032745361328
				},
				"model": 1204471037
			},
			"type": "single",
			"id": "472179357",
			"doubledoor": false
		},
		"560156585": {
			"door1": {
				"coords": {
					"y": 174.02354431152344,
					"x": -806.7716674804688,
					"z": 76.89032745361328
				},
				"model": -794543736
			},
			"type": "single",
			"id": "560156585",
			"doubledoor": false
		},
		"578058304": {
			"door1": {
				"coords": {
					"y": 182.56800842285156,
					"x": -794.185302734375,
					"z": 73.04045104980469
				},
				"model": 1245831483
			},
			"type": "double",
			"door2": {
				"coords": {
					"y": 180.50746154785156,
					"x": -793.3943481445312,
					"z": 73.04045104980469
				},
				"model": -1454760130
			},
			"id": "578058304",
			"doubledoor": true
		},
		"581118064": {
			"door1": {
				"coords": {
					"y": 179.09796142578125,
					"x": -816.7160034179688,
					"z": 72.82737731933594
				},
				"model": 159994461
			},
			"type": "double",
			"door2": {
				"coords": {
					"y": 177.5108642578125,
					"x": -816.1068115234375,
					"z": 72.82737731933594
				},
				"model": -1686014385
			},
			"id": "581118064",
			"doubledoor": true
		},
		"639745056": {
			"door1": {
				"coords": {
					"y": 185.97499084472656,
					"x": -815.2816162109375,
					"z": 72.99993133544922
				},
				"model": 30769481
			},
			"type": "single",
			"id": "639745056",
			"doubledoor": false
		},
		"738219245": {
			"door1": {
				"coords": {
					"y": 177.85536193847656,
					"x": -809.2808837890625,
					"z": 76.89032745361328
				},
				"model": -384976104
			},
			"type": "single",
			"id": "738219245",
			"doubledoor": false
		},
		"059102111": {
			"door1": {
				"coords": {
					"y": 177.22137451171875,
					"x": -796.565673828125,
					"z": 73.04045104980469
				},
				"model": -1454760130
			},
			"type": "double",
			"door2": {
				"coords": {
					"y": 178.0123748779297,
					"x": -794.505126953125,
					"z": 73.04045104980469
				},
				"model": 1245831483
			},
			"id": "059102111",
			"doubledoor": true
		}
	},
	"building": {
		"buildingtype": "small1",
		"rotation": {
			"x": 0,
			"y": 0,
			"z": 0
		},
		"coords": {
			"x": 0,
			"y": 0,
			"z": 0
		},
		"removeinprogress": false,
		"enabled": false
	},
	"images": [
		"https://cdn.discordapp.com/attachments/824073935880192080/1449753918870655188/screenshot.webp?ex=69400c0d&is=693eba8d&hm=b7d845831d6daee55939267f1b5906d2adf3e1ef1999d58e08eb5efdc3c7022e&",
		"https://cdn.discordapp.com/attachments/824073935880192080/1449753949124034621/screenshot.webp?ex=69400c14&is=693eba94&hm=bb13848caa1d0c7e8bebb9a2f1a260c9dc3e3fa01fc783645f83d8bf5f8fa7e4&"
	],
	"enter": {
		"coords": {
			"x": 0,
			"y": 0,
			"z": 0
		},
		"heading": 100
	},
	"adress": "Rockford Hills, West Eclipse Blvd & Portola Dr",
	"rentable": false,
	"cleanpoints": [],
	"sellsign": {
		"coords": {
			"x": -833.9260864257812,
			"y": 170.30650329589844,
			"z": 68.82571411132812
		},
		"heading": 319.9885559082031,
		"enabled": true,
		"removeinprogress": false
	},
	"tenantsrequests": [],
	"managment": {
		"coords": {
			"x": -811.2285766601562,
			"y": 178.6842803955078,
			"z": 71.65309143066406
		}
	},
	"shellpreset": "",
	"financedata": {
		"rentdebt": 0,
		"taxdebt": 0,
		"nextTickAt": 1767319029
	},
	"wardrobe": {
		"enabled": true,
		"coords": {
			"x": -806.9749145507812,
			"y": 172.88336181640625,
			"z": 72.33470916748047
		}
	},
	"ipltheme": "modern",
	"tenants": [],
	"rentprice": 0,
	"deliveries": [],
	"dancer": {
		"dancertype": "",
		"dance": 1,
		"coords": {
			"x": 0,
			"y": 0,
			"z": 0
		},
		"heading": 0,
		"enabled": false,
		"spawntime": 0
	},	
	"iplpreset": "",
	"island": {
		"rotation": {
			"x": 0,
			"y": 0,
			"z": 0
		},
		"coords": {
			"x": 0,
			"y": 0,
			"z": 0
		},
		"islandtype": "small1",
		"enabled": false,
		"removeinprogress": false
	},
	"keys": [],
	"list": {
		"rent": {
			"enabled": false,
			"price": 0
		},
		"listed": false,
		"number": "",
		"sale": {
			"enabled": false,
			"price": 0
		},
		"description": ""
	},
	"furnituredata": {
		"outside": {
			"presetOrder": [
				"default"
			],
			"presets": {
				"default": {
					"label": "Default",
					"items": {
						"305": {
							"placed": false,
							"rotation": {
								"x": 0,
								"y": 0,
								"z": 0
							},
							"pin": "0000",
							"object": "apa_mp_h_acc_fruitbowl_02",
							"coords": {
								"x": -816.8590087890625,
								"y": 178.00494384765625,
								"z": 71.2276382446289
							},
							"label": "apa_mp_h_acc_fruitbowl_02",
							"id": "305",
							"migrate": true
						},
						"341": {
							"rotation": {
								"y": 0,
								"x": 0,
								"z": 0
							},
							"pin": "0000",
							"object": "prop_tint_towel",
							"coords": {
								"y": 178.37274169921875,
								"x": -811.4221801757812,
								"z": 71.99661254882812
							},
							"label": "prop_tint_towel",
							"id": "341",
							"placed": true
						}
					},
					"count": 1,
					"id": "default",
					"order": [
						"341",
						"305"
					]
				}
			},
			"currentpreset": "default"
		},
		"inside": {
			"presetOrder": [
				"default"
			],
			"presets": {
				"default": {
					"label": "Default",
					"items": [],
					"count": 0,
					"id": "default",
					"order": []
				}
			},
			"currentpreset": "default"
		}
	},
	"partofcomplex": {
		"enabled": false,
		"complexid": ""
	},
	"upgrades": {
		"robotvacuum": {
			"id": "robotvacuum",
			"owned": false
		},
		"alarm": {
			"id": "alarm",
			"owned": false
		},
		"motion": {
			"id": "motion",
			"owned": false
		},
		"doorbell": {
			"id": "doorbell",
			"owned": true
		},
		"cameras": {
			"id": "cameras",
			"owned": false
		},
		"smarthome": {
			"id": "smarthome",
			"owned": false
		}
	},
	"description": "Michael House",
	"visitorlog": [
		{
			"text": "Doorbell rung",
			"visitortime": 1766450311
		},
		{
			"text": "Doorbell rung",
			"visitortime": 1766535441
		},
		{
			"text": "Doorbell rung",
			"visitortime": 1766535890
		},
		{
			"text": "Doorbell rung",
			"visitortime": 1766536333
		},
		{
			"text": "Doorbell rung",
			"visitortime": 1767062594
		}
	]
}]]--

GetAllProperties

exports["rtx_housing"]:GetAllProperties()

Returns all properties registered in the housing system (table)

chevron-rightExamplehashtag
local properties = exports["rtx_housing"]:GetAllProperties()

RemovePropertyOwnership

Removes ownership of the specified property.

Parameters:

  • propertyId (number)

DeleteProperty

Completely deletes a property from database and memory.

Parameters:

  • propertyId (number)

IsPlayerInsideProperty

Checks whether a specific player is inside a property.

Parameters:

  • source (player id)

Returns:

  • true / false (boolean)

  • propertyId

chevron-rightExamplehashtag

CheckPropertyKeys

Checks whether a player owns keys to a property.

Parameters:

  • source (player id)

  • propertyId (number)

Returns:

  • true / false (boolean)

chevron-rightExamplehashtag

GetPropertyPermissions

Returns all permission values for a player on a property.

Parameters:

  • source (player id)

  • propertyId (number)

Returns:

  • table of permission values

chevron-rightExamplehashtag

HasPlayerAnyPropertyPermissions

Checks if the local player has at least one permission for the property.

Parameters:

  • source (player id)

  • propertyId (number)

Returns:

  • true / false (boolean)

chevron-rightExamplehashtag

GetPropertyPermission

Returns whether the player has the required permission in the property

Permission types:

  • furnitureMenu

  • unlocking

  • wardrobe

  • storage

  • manageKeys

  • upgrades

  • payBills

  • garage

  • orderServices

  • tenants

  • clean

  • doorbell

  • cameras

  • services

  • positions

Parameters:

  • source (player id)

  • propertyId (number)

  • permission type

Returns:

  • true / false (boolean)

chevron-rightExamplehashtag

EnterPropertyPlayer

Forces a player to enter the specified property.

Parameters:

  • source (player id)

  • propertyId (number)

ExitPropertyPlayer

Forces a player to exit their current property.

Parameters:

  • source (player id)

  • propertyId (number)

GetPlayerOwnedProperties

Returns all properties owned by the player

Parameters:

  • source (player id or player identifier)

Returns:

  • all properties owned by the player. (table)

chevron-rightExampleshashtag

GivePropertySource

Assigns ownership using server ID.

Parameters:

  • source (player id)

  • propertyId (number)

GivePropertyIdentifier

Assigns ownership using player identifier.

Parameters:

  • identifier (player identifier, citizenid, steam id for example)

  • propertyId (number)

GiveStarterApartment

Creates a starter apartment for the player (requires Config.StarterApartments setup).

Tutorial for Starter Apartments

Starter Apartmentschevron-right

Parameters:

  • source (player id)

TeleportPlayerToStartingApartment

Teleports player into the starting apartment.

Parameters:

  • source (player id)

Last updated