Community Suggestion Auto-sell unused properties in a certain timeframe.

Status
Not open for further replies.
Messages
73
Reaction score
39
Points
300
Location
UK
Suggestion Title: Auto-sell unused properties in a certain timeframe.
Suggestion Description: I'd like to see the auto selling of properties introduced to help balance properties being bought and not used. It's been quite a regular thing of late, especially when you raid and it's just empty and there are people out there waiting to get a property.

I'd like to suggest that the owner of the property must use their keys on any door of that property within a 30 minute period or the property auto sells. I think this will help keep the balance in the city and that properties are used as they're meant to be.

Why should this be added?:
Will help reduce overpopulation of properties
Stop minging and re-selling
Allow players to get a property and use it for it's intended purpose.

What negatives could this have?:
- AFK kicks and properties selling with people still inside them

What problem would this suggestion solve?: This aims to resolve people holding properties and would also mean they can be re-sold automatically without MOD intervention.
 
The code could look something like this (just something put together quickly)

-- Property Autosell Script

-- Configuration
local PROPERTY_NAME = "Suburbs 7"
local TIME_LIMIT = 1800 -- 30 minutes in seconds

-- Placeholder function to get a player's property
local function GetPlayerProperty(player)
return player:GetNWString("OwnedProperty", "")
end

-- Placeholder function to autosell the property
local function AutoSellProperty(player)
-- This function should handle the autoselling logic
-- Replace this with your actual autosell logic
player:SetNWString("OwnedProperty", "")
-- Refund money or any other necessary logic
print(player:Nick() .. " has lost ownership of " .. PROPERTY_NAME .. " due to inactivity.")
end

-- Table to store the last key usage time for each player
local playerKeyUsage = {}

-- Hook to track key usage
hook.Add("PlayerUse", "TrackKeyUsage", function(player, entity)
if GetPlayerProperty(player) == PROPERTY_NAME and entity:IsDoor() then
playerKeyUsage[player:SteamID()] = CurTime()
end
end)

-- Timer to check for inactivity
timer.Create("CheckPropertyInactivity", 60, 0, function()
for _, player in pairs(player.GetAll()) do
if GetPlayerProperty(player) == PROPERTY_NAME then
local lastUsage = playerKeyUsage[player:SteamID()] or 0
if CurTime() - lastUsage > TIME_LIMIT then
AutoSellProperty(player)
end
end
end
end)

-- Hook to initialize key usage time on player spawn
hook.Add("PlayerInitialSpawn", "InitializeKeyUsage", function(player)
if GetPlayerProperty(player) == PROPERTY_NAME then
playerKeyUsage[player:SteamID()] = CurTime()
end
end)

-- Hook to clean up on player disconnect
hook.Add("PlayerDisconnected", "CleanupKeyUsage", function(player)
playerKeyUsage[player:SteamID()] = nil
end)
 
I'd like to suggest that the owner of the property must use their keys on any door of that property within a 30 minute period or the property auto sells.
30 minutes is nowhere near enough, cocaine takes 36-38 minutes to get to ready & 46-50 minutes to get to seeding & people usually just afk powergrow. Also what if the property is in use by people with keys but not specifically the property owner himself?

I can recall a few instances where my org mates would buy properties for me to hide in then them go afk because I was unable to buy properties due to me being warranted
 
This is true, all good points which is why any door, front back or internal doors. If your coke is locked in the bathroom you're going to unlock it to check on it's progress every now and again, perhaps a slight tweak to it
 
If your coke is locked in the bathroom you're going to unlock it to check on it's progress every now and again
yes, but what about properties such as parker & glassco?

something such as what you're suggesting is very easy to forget in the start
 




I've done this, just havent pushed it yet, its going to be based on chest usage and not doors
 
Status
Not open for further replies.

Similar threads

  • Locked
  • Suggestion Suggestion
Server Suggestion Inactive Property Check
Replies
7
Views
951
  • Suggestion Suggestion
Server Suggestion Property grace period
Replies
6
Views
1K
  • Suggestion Suggestion
Server Suggestion Rental lease renewal
Replies
0
Views
382
Back
Top