Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restruct #18

Merged
merged 2 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions client/MainHousing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,4 @@ end)

RegisterNetEvent('bcc-housing:HousingTableUpdate', function(houseId) --event to update the housing table
table.insert(OwnedHotels, houseId)
end)

--[[
--Sacred Comment
8========D
]]
end)
2 changes: 1 addition & 1 deletion client/MenuSetup/manageHouseMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ function enterTpHouse(houseTable)
Wait(1000)
FreezeEntityPosition(pped, false)
showManageOpt(houseTable.exitCoords.x, houseTable.exitCoords.y, houseTable.exitCoords.z)
end
end
5 changes: 1 addition & 4 deletions client/functions.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
----- Pulling Essentials -----
VORPcore = {}
TriggerEvent("getCore", function(core)
VORPcore = core
end)
VORPcore = exports.vorp_core:GetCore()
VORPutils = {}
TriggerEvent("getUtils", function(utils)
VORPutils = utils
Expand Down
421 changes: 202 additions & 219 deletions config.lua

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
fx_version "adamant"
games {"rdr3"}
rdr3_warning "I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships."

lua54 "yes"

shared_scripts {
Expand All @@ -12,8 +11,11 @@ shared_scripts {

server_scripts {
"@oxmysql/lib/MySQL.lua",
"/server/server.lua",
'/server/adminManagment.lua'
'server/helpers/functions.lua',
'server/services/dbupdater.lua',
'server/helpers/*.lua',
'server/services/*.lua',
"/server/main.lua"
}

client_scripts {
Expand All @@ -38,4 +40,6 @@ dependency {
'bcc-doorlocks'
}

version '1.0.3'
-- u can set doors but if u set one with an id first it will break so u have to set one without an id first then add id doors

version '1.0.4'
23 changes: 0 additions & 23 deletions housingsql.sql

This file was deleted.

37 changes: 37 additions & 0 deletions server/helpers/functions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---- Pulling Essentials -----
VORPcore = {}
TriggerEvent("getCore", function(core)
VORPcore = core
end)
VORPInv = {}
VORPInv = exports.vorp_inventory:vorp_inventoryApi()
BccUtils = exports['bcc-utils'].initiate()
Discord = BccUtils.Discord.setup(Config.WebhookLink, 'bcc-housing', 'https://steamuserimages-a.akamaihd.net/ugc/1759186614239848553/8C42E78A07CB85399889CD5C82C63235F6C61F0F/?imw=637&imh=358&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true')

DbUpdated = false -- Use this to stop taxes from running till db has been made

--get players info list
PlayersTable = {}
RegisterServerEvent('bcc-housing:GetPlayers', function()
local _source, data = source, {}

for _, player in ipairs(PlayersTable) do
local User = VORPcore.getUser(player)
if User then
local Character = User.getUsedCharacter --get player info
local playername = Character.firstname .. ' ' .. Character.lastname --player char name
data[tostring(player)] = {
serverId = player,
PlayerName = playername,
staticid = Character.charIdentifier,
}
end
end
TriggerClientEvent("bcc-housing:SendPlayers", _source, data)
end)

-- check if staff is available
RegisterServerEvent("bcc-housing:getPlayersInfo", function(source)
local _source = source
PlayersTable[#PlayersTable + 1] = _source -- add all players
end)
17 changes: 17 additions & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
RegisterServerEvent("bcc-housing:AdminCheck", function()
local _source, admin = source, false
local character = VORPcore.getUser(_source).getUsedCharacter
if character.group == Config.adminGroup then
TriggerClientEvent("bcc-housing:AdminClientCatch", _source, true)
end

if not admin then
for k, v in pairs(Config.ALlowedJobs) do
if character.job == v.jobname then
TriggerClientEvent('bcc-housing:AdminClientCatch', _source, true) break
end
end
end
end)

BccUtils.Versioner.checkRelease(GetCurrentResourceName(), 'https://github.com/BryceCanyonCounty/bcc-housing')
Loading