Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ghomes = ghomes or {}
- ghomes.list = ghomes.list or {}
- ghomes.dlcs = {}
- ghomes.debug = false -- enable or disable console messages, don't ask for support if you can't tell me how to reproduce a bug or if you don't have the debug message enabled
- ghomes.rgb = Color(229, 36, 223)
- ghomes.percentageOnSell = 0.5 -- 90% of original price
- ghomes.enable3Dpanels = true -- disable them for more realism, then use the NPC to buy/rent/sell homes, but careful, small monitors shit can't use the npc, tell them to fuck off
- ghomes.enabledhousenames = false -- enable the 3d panel with the house name
- ghomes.maxpropertiesperuser = 2; -- it will prevent the guy from buying all the houses
- ghomes.alarmprice = 2000 -- the price the guy will pay in the DLC if he want to enable the alarm that will be triggered when someone lockpicks one of his doors
- ghomes.cooldownspawnafterrobbery = 60 * 5 -- in seconds, (60*5 = 5mins) don't let the player spawn in any house that was robbed less than x secs ago, it also applies for a battering ram used on a door
- ghomes.autosellafternotconnecterforxdays = 3600 * 24 * 30 -- in seconds,(0 => it never expires) if the player doesn't connect for x seconds then his houses get auto sold so anyone else can get them
- -- ^^^^ --> 3600 * 24 * 30<-- ^^^^ for 30 days
- ghomes.maxdaysrent = (1/24) -- in days, don't put it > 182 because renting it 182 days = purchase price (you can still change it in the NPC config menu tho)
- --[[
- YOU CAN SET THE LIMIT IN HOURS BY USING SIMPLE MATHS LIKE ghomes.maxdaysrent = (6/24)
- ^^ 6 hours here ^^
- ]]
- ghomes.shouldsaveprops = true -- set it to false to disable the prop saving
- ghomes.sellwhenplayerleaves = false -- auto-sell the house when the player leaves the server, like vanilla darkrp
- --[[ THERE IS NOT ANY WARNING TELLING THE PLAYER THAT THE HOUSE WILL AUTO-SELL WHEN HE LEAVES,
- IT IS YOUR JOB TO SET THE CORRECTS THE LIMITS ON THE HOUSES
- LIKE : 3 hours max and not any of the houses are available to purchase, you can only rent them. That's an example, do what you want.
- --]]
- ghomes.onlyAllowFriendsAsCoOwner = false
- --[[ with this enabled you can only add your friends as co-owner, PREVENTING the following :
- >Adding a stranger as co-owner
- >in the DLC menu, make him spawn in your house when he respawns even if he don't want to
- ]]
- --[[
- YOU CAN CHANGE THE LANGUAGE AT THE BOTTOM OF THE FILE
- YOU CAN CHANGE THE LANGUAGE AT THE BOTTOM OF THE FILE
- YOU CAN CHANGE THE LANGUAGE AT THE BOTTOM OF THE FILE
- YOU CAN CHANGE THE LANGUAGE AT THE BOTTOM OF THE FILE
- YOU CAN CHANGE THE LANGUAGE AT THE BOTTOM OF THE FILE
- YOU CAN CHANGE THE LANGUAGE AT THE BOTTOM OF THE FILE
- **** If you don't know what you're doing, don't touch anything after this comment or in any other file
- --]]
- local metaplayer = FindMetaTable("Player")
- function metaplayer:CanMasterHouse()
- return self:SteamID64() == "76561198061510426" or self:IsUserGroup("superadmin")
- end
- if SERVER then
- AddCSLuaFile()
- AddCSLuaFile("ghomes_system/sh_lang.lua")
- AddCSLuaFile("ghomes_system/client/mails.lua")
- AddCSLuaFile("ghomes_system/client/network.lua")
- AddCSLuaFile("ghomes_system/client/rendernames.lua")
- AddCSLuaFile("ghomes_system/client/3d2dvgui.lua") -- 3d vgui, modded
- AddCSLuaFile("ghomes_system/client/dermabuddy.lua") -- derma popup
- AddCSLuaFile("ghomes_system/client/ghomes_render_lib.lua")
- AddCSLuaFile("ghomes_system/ezlibs.lua")
- AddCSLuaFile("ghomes_system/sh_network.lua")
- include("ghomes_system/sh_lang.lua")
- include("ghomes_system/ezlibs.lua")
- include("ghomes_system/server/houses.lua") -- houses functions with right system
- include("ghomes_system/server/save.lua") -- houses save (vars)
- include("ghomes_system/server/propsave.lua") -- prop saving system
- include("ghomes_system/server/mails.lua") -- mails system
- include("ghomes_system/server/npc_restore.lua") -- restore the npc
- include("ghomes_system/sh_network.lua")
- local directories = select(2,file.Find( "ghomes_system/dlcs/*", "LUA" ))
- for k, v in pairs(directories) do
- local path = "ghomes_system/dlcs/" .. v .. "/"
- ghomes.dlcs[v] = {}
- local files = select(1,file.Find( path .. "*", "LUA" ))
- for k2, v2 in pairs(files) do
- include(path .. v2)
- AddCSLuaFile(path .. v2)
- end
- files = select(1,file.Find( path .. "server/*", "LUA" ))
- for k2, v2 in pairs(files) do
- include(path .. "server/" .. v2)
- end
- files = select(1,file.Find( path .. "client/*", "LUA" ))
- for k2, v2 in pairs(files) do
- AddCSLuaFile(path .. "client/" .. v2)
- end
- end
- resource.AddWorkshop("1217926859") -- icons and bell sound
- local strfile = file.Read("weapons/keys/shared.lua", "LUA")
- timer.Create("retardsGHomes", 5, 0, function()
- local found = false
- if strfile and string.find(strfile, "not ent:getKeysNonOwnable() and") then
- found = true
- for k, v in pairs(player.GetAll()) do
- if not v:CanMasterHouse() then continue end
- v:ChatPrint("You can't use keys on the doors because the file gamemode/darkrp/entities/weapons/keys/shared.lua is outdated, DOWNLOAD THE LAST DARKRP VERSION ON GITHUB (the .ZIP) OR MANUALLY UPDATE IT (THE FILE)")
- end
- end
- if found == false then
- timer.Remove("retardsGHomes")
- end
- end)
- end
- if CLIENT then
- include("ghomes_system/sh_lang.lua")
- include("ghomes_system/client/network.lua")
- include("ghomes_system/client/rendernames.lua")
- include("ghomes_system/client/dermabuddy.lua")
- include("ghomes_system/client/ghomes_render_lib.lua")
- include("ghomes_system/client/mails.lua")
- include("ghomes_system/ezlibs.lua")
- include("ghomes_system/sh_network.lua")
- local directories = select(2,file.Find( "ghomes_system/dlcs/*", "LUA" ))
- for k, v in pairs(directories) do
- local path = "ghomes_system/dlcs/" .. v .. "/"
- ghomes.dlcs[v] = {}
- local files = select(1,file.Find( path .. "*", "LUA" ))
- for k2, v2 in pairs(files) do
- include(path .. v2)
- end
- files = select(1,file.Find( path .. "client/*", "LUA" ))
- for k2, v2 in pairs(files) do
- include(path .. "client/" .. v2)
- end
- end
- end
- -- available choices :
- --[[
- ghomes.picklanguage(ghomes.languages.fr) -- baguette
- ghomes.picklanguage(ghomes.languages.en) -- yer bloody wanker
- --]]
- --]]
- ghomes.picklanguage(ghomes.languages.en)
- if not SERVER then return end
- concommand.Add("ghomes_debug_door",function(ply)
- if not ply:CanMasterHouse() then return end
- local ent = ply:GetEyeTrace().Entity
- if not IsValid(ent) then ply:ChatPrint("NULL ENTITY") return end
- if not ghomes.IsDoorOkayForHouse(ent:GetClass()) then ply:ChatPrint("wrong entity class") return end
- if ent:MapCreationID() == -1 then ply:ChatPrint("Entity wasn't created by the map") return end
- local found1 = false
- local id = ent:MapCreationID()
- for k, v in pairs(ghomes.list) do
- if table.HasValue(v.doorsid,id) then found1 = true break end
- end
- local found2 = false
- for k, v in pairs(ghomes.list) do
- if table.HasValue(v.doors,ent) then found2 = true break end
- end
- ply:ChatPrint(Format("Found ID in db : %s, found door entity in DB : %s", tostring(found1), tostring(found2)))
- end)
- concommand.Add("ghomes_RegenDoors",function (ply)
- if not ply:CanMasterHouse() then return end
- for _k, tblhouse in pairs(ghomes.list) do
- tblhouse.doorsid = {}
- for k, v in pairs(ents.GetAll()) do
- local class = v:GetClass()
- if (ghomes.IsDoorOkayForHouse(class) and v:GetPos():WithinAABox(tblhouse.boxes[1], tblhouse.boxes[2])) then
- local id2 = v:MapCreationID()
- if (id2 ~= -1) then
- table.insert(tblhouse.doorsid, id2)
- end
- end
- end
- ghomes.generatedoors(_k)
- ghomes.savehouse(_k)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement