This commit is contained in:
Nordi98 2025-06-10 17:37:12 +02:00
parent 6d90da2841
commit b71b47a9fb
169 changed files with 12687 additions and 2932 deletions

View file

@ -0,0 +1,324 @@
-- Office 1: -141.1987, -620.913, 168.8205 (Arcadius Business Centre)
exports('GetFinanceOffice1Object', function()
return FinanceOffice1
end)
FinanceOffice1 = {
currentInteriorId = -1,
currentSafeDoors = {
hashL = "",
hashR = ""
},
Style = {
Theme = {
warm = {
interiorId = 236289,
ipl = "ex_dt1_02_office_01a",
safe = "ex_prop_safedoor_office1a"
},
classical = {
interiorId = 236545,
ipl = "ex_dt1_02_office_01b",
safe = "ex_prop_safedoor_office1b"
},
vintage = {
interiorId = 236801,
ipl = "ex_dt1_02_office_01c",
safe = "ex_prop_safedoor_office1c"
},
contrast = {
interiorId = 237057,
ipl = "ex_dt1_02_office_02a",
safe = "ex_prop_safedoor_office2a"
},
rich = {
interiorId = 237313,
ipl = "ex_dt1_02_office_02b",
safe = "ex_prop_safedoor_office2a"
},
cool = {
interiorId = 237569,
ipl = "ex_dt1_02_office_02c",
safe = "ex_prop_safedoor_office2a"
},
ice = {
interiorId = 237825,
ipl = "ex_dt1_02_office_03a",
safe = "ex_prop_safedoor_office3a"
},
conservative = {
interiorId = 238081,
ipl = "ex_dt1_02_office_03b",
safe = "ex_prop_safedoor_office3a"
},
polished = {
interiorId = 238337,
ipl = "ex_dt1_02_office_03c",
safe = "ex_prop_safedoor_office3c"
}
},
Set = function(style, refresh)
if refresh == nil then
refresh = false
end
if type(style) == "table" then
FinanceOffice1.Style.Clear()
FinanceOffice1.currentInteriorId = style.interiorId
FinanceOffice1.currentSafeDoors = {
hashL = GetHashKey(style.safe .. "_l"),
hashR = GetHashKey(style.safe .. "_r")
}
EnableIpl(style.ipl, true)
if refresh then
RefreshInterior(style.interiorId)
end
end
end,
Clear = function()
for themeKey, themeValue in pairs(FinanceOffice1.Style.Theme) do
for swagKey, swagValue in pairs(FinanceOffice1.Swag) do
if type(swagValue) == "table" then
SetIplPropState(themeValue.interiorId, {
swagValue.A,
swagValue.B,
swagValue.C
}, false)
end
end
SetIplPropState(themeValue.interiorId, "office_chairs", false, false)
SetIplPropState(themeValue.interiorId, "office_booze", false, true)
FinanceOffice1.currentSafeDoors = {
hashL = 0,
hashR = 0
}
EnableIpl(themeValue.ipl, false)
end
end
},
Safe = {
doorHeadingL = 96.0, -- Only need the heading of the Left door to get the Right ones
Position = vector3(-124.25, -641.30, 168.870), -- Approximately between the two doors
-- These values are checked from "doorHandler.lua" and
isLeftDoorOpen = false,
isRightDoorOpen = false,
-- Safe door API
Open = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice1.Safe.isLeftDoorOpen = true
elseif doorSide:lower() == "right" then
FinanceOffice1.Safe.isRightDoorOpen = true
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice1.Safe.isLeftDoorOpen = false
elseif doorSide:lower() == "right" then
FinanceOffice1.Safe.isRightDoorOpen = false
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
-- Internal use only
SetDoorState = function(doorSide, open)
local doorHandle = 0
local heading = FinanceOffice1.Safe.doorHeadingL
if doorSide:lower() == "left" then
doorHandle = FinanceOffice1.Safe.GetDoorHandle(FinanceOffice1.currentSafeDoors.hashL)
if open then
heading = heading - 90.0
end
elseif doorSide:lower() == "right" then
doorHandle = FinanceOffice1.Safe.GetDoorHandle(FinanceOffice1.currentSafeDoors.hashR)
heading = heading - 180
if open then
heading = heading + 90.0
end
end
if doorHandle == 0 then
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end
SetEntityHeading(doorHandle, heading)
end,
-- /!\ handle changes whenever the interior is refreshed /!\
GetDoorHandle = function(doorHash)
local timeout = 4
local doorHandle = GetClosestObjectOfType(FinanceOffice1.Safe.Position.x, FinanceOffice1.Safe.Position.y, FinanceOffice1.Safe.Position.z, 5.0, doorHash, false, false, false)
while doorHandle == 0 do
Wait(25)
doorHandle = GetClosestObjectOfType(FinanceOffice1.Safe.Position.x, FinanceOffice1.Safe.Position.y, FinanceOffice1.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
if timeout <= 0 then
break
end
end
return doorHandle
end
},
Swag = {
Cash = {
A = "cash_set_01",
B = "cash_set_02",
C = "cash_set_03",
D = "cash_set_04",
E = "cash_set_05",
F = "cash_set_06",
G = "cash_set_07",
H = "cash_set_08",
I = "cash_set_09",
J = "cash_set_10",
K = "cash_set_11",
L = "cash_set_12",
M = "cash_set_13",
N = "cash_set_14",
O = "cash_set_15",
P = "cash_set_16",
Q = "cash_set_17",
R = "cash_set_18",
S = "cash_set_19",
T = "cash_set_20",
U = "cash_set_21",
V = "cash_set_22",
W = "cash_set_23",
X = "cash_set_24"
},
BoozeCigs = {
A = "swag_booze_cigs",
B = "swag_booze_cigs2",
C = "swag_booze_cigs3"
},
Counterfeit = {
A = "swag_counterfeit",
B = "swag_counterfeit2",
C = "swag_counterfeit3"
},
DrugBags = {
A = "swag_drugbags",
B = "swag_drugbags2",
C = "swag_drugbags3"
},
DrugStatue = {
A = "swag_drugstatue",
B = "swag_drugstatue2",
C = "swag_drugstatue3"
},
Electronic = {
A = "swag_electronic",
B = "swag_electronic2",
C = "swag_electronic3"
},
FurCoats = {
A = "swag_furcoats",
B = "swag_furcoats2",
C = "swag_furcoats3"
},
Gems = {
A = "swag_gems",
B = "swag_gems2",
C = "swag_gems3"
},
Guns = {
A = "swag_guns",
B = "swag_guns2",
C = "swag_guns3"
},
Ivory = {
A = "swag_ivory",
B = "swag_ivory2",
C = "swag_ivory3"
},
Jewel = {
A = "swag_jewelwatch",
B = "swag_jewelwatch2",
C = "swag_jewelwatch3"
},
Med = {
A = "swag_med",
B = "swag_med2",
C = "swag_med3"
},
Painting = {
A = "swag_art",
B = "swag_art2",
C = "swag_art3"
},
Pills = {
A = "swag_pills",
B = "swag_pills2",
C = "swag_pills3"
},
Silver = {
A = "swag_silver",
B = "swag_silver2",
C = "swag_silver3"
},
Enable = function(details, state, refresh)
SetIplPropState(FinanceOffice1.currentInteriorId, details, state, refresh)
end
},
Chairs = {
off = "",
on = "office_chairs",
Set = function(chairs, refresh)
FinanceOffice1.Chairs.Clear(false)
if chairs ~= nil then
SetIplPropState(FinanceOffice1.currentInteriorId, chairs, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice1.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice1.currentInteriorId, FinanceOffice1.Chairs.on, false, refresh)
end
},
Booze = {
off = "",
on = "office_booze",
Set = function(booze, refresh)
FinanceOffice1.Booze.Clear(false)
if booze ~= nil then
SetIplPropState(FinanceOffice1.currentInteriorId, booze, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice1.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice1.currentInteriorId, FinanceOffice1.Booze.on, false, refresh)
end
},
LoadDefault = function()
FinanceOffice1.Style.Set(FinanceOffice1.Style.Theme.polished)
FinanceOffice1.Chairs.Set(FinanceOffice1.Chairs.on, true)
end
}

View file

@ -0,0 +1,324 @@
-- Office 2: -75.8466, -826.9893, 243.3859 (Maze Bank Building)
exports('GetFinanceOffice2Object', function()
return FinanceOffice2
end)
FinanceOffice2 = {
currentInteriorId = -1,
currentSafeDoors = {
hashL = "",
hashR = ""
},
Style = {
Theme = {
warm = {
interiorId = 238593,
ipl = "ex_dt1_11_office_01a",
safe = "ex_prop_safedoor_office1a"
},
classical = {
interiorId = 238849,
ipl = "ex_dt1_11_office_01b",
safe = "ex_prop_safedoor_office1b"
},
vintage = {
interiorId = 239105,
ipl = "ex_dt1_11_office_01c",
safe = "ex_prop_safedoor_office1c"
},
contrast = {
interiorId = 239361,
ipl = "ex_dt1_11_office_02a",
safe = "ex_prop_safedoor_office2a"
},
rich = {
interiorId = 239617,
ipl = "ex_dt1_11_office_02b",
safe = "ex_prop_safedoor_office2a"
},
cool = {
interiorId = 239873,
ipl = "ex_dt1_11_office_02c",
safe = "ex_prop_safedoor_office2a"
},
ice = {
interiorId = 240129,
ipl = "ex_dt1_11_office_03a",
safe = "ex_prop_safedoor_office3a"
},
conservative = {
interiorId = 240385,
ipl = "ex_dt1_11_office_03b",
safe = "ex_prop_safedoor_office3a"
},
polished = {
interiorId = 240641,
ipl = "ex_dt1_11_office_03c",
safe = "ex_prop_safedoor_office3c"
}
},
Set = function(style, refresh)
if refresh == nil then
refresh = false
end
if type(style) == "table" then
FinanceOffice2.Style.Clear()
FinanceOffice2.currentInteriorId = style.interiorId
FinanceOffice2.currentSafeDoors = {
hashL = GetHashKey(style.safe .. "_l"),
hashR = GetHashKey(style.safe .. "_r")
}
EnableIpl(style.ipl, true)
if refresh then
RefreshInterior(style.interiorId)
end
end
end,
Clear = function()
for themeKey, themeValue in pairs(FinanceOffice2.Style.Theme) do
for swagKey, swagValue in pairs(FinanceOffice2.Swag) do
if type(swagValue) == "table" then
SetIplPropState(themeValue.interiorId, {
swagValue.A,
swagValue.B,
swagValue.C
}, false)
end
end
SetIplPropState(themeValue.interiorId, "office_chairs", false, false)
SetIplPropState(themeValue.interiorId, "office_booze", false, true)
FinanceOffice2.currentSafeDoors = {
hashL = 0,
hashR = 0
}
EnableIpl(themeValue.ipl, false)
end
end
},
Safe = {
doorHeadingL = 250.0, -- Only need the heading of the Left door to get the Right ones
Position = vector3(-82.593, -801.0, 243.385), -- Approximately between the two doors
-- These values are checked from "doorHandler.lua" and
isLeftDoorOpen = false,
isRightDoorOpen = false,
-- Safe door API
Open = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice2.Safe.isLeftDoorOpen = true
elseif doorSide:lower() == "right" then
FinanceOffice2.Safe.isRightDoorOpen = true
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice2.Safe.isLeftDoorOpen = false
elseif doorSide:lower() == "right" then
FinanceOffice2.Safe.isRightDoorOpen = false
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
-- Internal use only
SetDoorState = function(doorSide, open)
local doorHandle = 0
local heading = FinanceOffice2.Safe.doorHeadingL
if doorSide:lower() == "left" then
doorHandle = FinanceOffice2.Safe.GetDoorHandle(FinanceOffice2.currentSafeDoors.hashL)
if open then
heading = heading - 90.0
end
elseif doorSide:lower() == "right" then
doorHandle = FinanceOffice2.Safe.GetDoorHandle(FinanceOffice2.currentSafeDoors.hashR)
heading = heading - 180
if open then
heading = heading + 90.0
end
end
if doorHandle == 0 then
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end
SetEntityHeading(doorHandle, heading)
end,
-- /!\ handle changes whenever the interior is refreshed /!\
GetDoorHandle = function(doorHash)
local timeout = 4
local doorHandle = GetClosestObjectOfType(FinanceOffice2.Safe.Position.x, FinanceOffice2.Safe.Position.y, FinanceOffice2.Safe.Position.z, 5.0, doorHash, false, false, false)
while doorHandle == 0 do
Wait(25)
doorHandle = GetClosestObjectOfType(FinanceOffice2.Safe.Position.x, FinanceOffice2.Safe.Position.y, FinanceOffice2.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
if timeout <= 0 then
break
end
end
return doorHandle
end
},
Swag = {
Cash = {
A = "cash_set_01",
B = "cash_set_02",
C = "cash_set_03",
D = "cash_set_04",
E = "cash_set_05",
F = "cash_set_06",
G = "cash_set_07",
H = "cash_set_08",
I = "cash_set_09",
J = "cash_set_10",
K = "cash_set_11",
L = "cash_set_12",
M = "cash_set_13",
N = "cash_set_14",
O = "cash_set_15",
P = "cash_set_16",
Q = "cash_set_17",
R = "cash_set_18",
S = "cash_set_19",
T = "cash_set_20",
U = "cash_set_21",
V = "cash_set_22",
W = "cash_set_23",
X = "cash_set_24"
},
BoozeCigs = {
A = "swag_booze_cigs",
B = "swag_booze_cigs2",
C = "swag_booze_cigs3"
},
Counterfeit = {
A = "swag_counterfeit",
B = "swag_counterfeit2",
C = "swag_counterfeit3"
},
DrugBags = {
A = "swag_drugbags",
B = "swag_drugbags2",
C = "swag_drugbags3"
},
DrugStatue = {
A = "swag_drugstatue",
B = "swag_drugstatue2",
C = "swag_drugstatue3"
},
Electronic = {
A = "swag_electronic",
B = "swag_electronic2",
C = "swag_electronic3"
},
FurCoats = {
A = "swag_furcoats",
B = "swag_furcoats2",
C = "swag_furcoats3"
},
Gems = {
A = "swag_gems",
B = "swag_gems2",
C = "swag_gems3"
},
Guns = {
A = "swag_guns",
B = "swag_guns2",
C = "swag_guns3"
},
Ivory = {
A = "swag_ivory",
B = "swag_ivory2",
C = "swag_ivory3"
},
Jewel = {
A = "swag_jewelwatch",
B = "swag_jewelwatch2",
C = "swag_jewelwatch3"
},
Med = {
A = "swag_med",
B = "swag_med2",
C = "swag_med3"
},
Painting = {
A = "swag_art",
B = "swag_art2",
C = "swag_art3"
},
Pills = {
A = "swag_pills",
B = "swag_pills2",
C = "swag_pills3"
},
Silver = {
A = "swag_silver",
B = "swag_silver2",
C = "swag_silver3"
},
Enable = function(details, state, refresh)
SetIplPropState(FinanceOffice2.currentInteriorId, details, state, refresh)
end
},
Chairs = {
off = "",
on = "office_chairs",
Set = function(chairs, refresh)
FinanceOffice2.Chairs.Clear(false)
if chairs ~= nil then
SetIplPropState(FinanceOffice2.currentInteriorId, chairs, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice2.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice2.currentInteriorId, FinanceOffice2.Chairs.on, false, refresh)
end
},
Booze = {
off = "",
on = "office_booze",
Set = function(booze, refresh)
FinanceOffice2.Booze.Clear(false)
if booze ~= nil then
SetIplPropState(FinanceOffice2.currentInteriorId, booze, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice2.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice2.currentInteriorId, FinanceOffice2.Booze.on, false, refresh)
end
},
LoadDefault = function()
FinanceOffice2.Style.Set(FinanceOffice2.Style.Theme.warm)
FinanceOffice2.Chairs.Set(FinanceOffice2.Chairs.on, true)
end
}

View file

@ -0,0 +1,324 @@
-- Office 3: -1579.756, -565.0661, 108.523 (Lom Bank)
exports('GetFinanceOffice3Object', function()
return FinanceOffice3
end)
FinanceOffice3 = {
currentInteriorId = -1,
currentSafeDoors = {
hashL = "",
hashR = ""
},
Style = {
Theme = {
warm = {
interiorId = 240897,
ipl = "ex_sm_13_office_01a",
safe = "ex_prop_safedoor_office1a"
},
classical = {
interiorId = 241153,
ipl = "ex_sm_13_office_01b",
safe = "ex_prop_safedoor_office1b"
},
vintage = {
interiorId = 241409,
ipl = "ex_sm_13_office_01c",
safe = "ex_prop_safedoor_office1c"
},
contrast = {
interiorId = 241665,
ipl = "ex_sm_13_office_02a",
safe = "ex_prop_safedoor_office2a"
},
rich = {
interiorId = 241921,
ipl = "ex_sm_13_office_02b",
safe = "ex_prop_safedoor_office2a"
},
cool = {
interiorId = 242177,
ipl = "ex_sm_13_office_02c",
safe = "ex_prop_safedoor_office2a"
},
ice = {
interiorId = 242433,
ipl = "ex_sm_13_office_03a",
safe = "ex_prop_safedoor_office3a"
},
conservative = {
interiorId = 242689,
ipl = "ex_sm_13_office_03b",
safe = "ex_prop_safedoor_office3a"
},
polished = {
interiorId = 242945,
ipl = "ex_sm_13_office_03c",
safe = "ex_prop_safedoor_office3c"
}
},
Set = function(style, refresh)
if refresh == nil then
refresh = false
end
if type(style) == "table" then
FinanceOffice3.Style.Clear()
FinanceOffice3.currentInteriorId = style.interiorId
FinanceOffice3.currentSafeDoors = {
hashL = GetHashKey(style.safe .. "_l"),
hashR = GetHashKey(style.safe .. "_r")
}
EnableIpl(style.ipl, true)
if refresh then
RefreshInterior(style.interiorId)
end
end
end,
Clear = function()
for themeKey, themeValue in pairs(FinanceOffice3.Style.Theme) do
for swagKey, swagValue in pairs(FinanceOffice3.Swag) do
if type(swagValue) == "table" then
SetIplPropState(themeValue.interiorId, {
swagValue.A,
swagValue.B,
swagValue.C
}, false)
end
end
SetIplPropState(themeValue.interiorId, "office_chairs", false, false)
SetIplPropState(themeValue.interiorId, "office_booze", false, true)
FinanceOffice3.currentSafeDoors = {
hashL = 0,
hashR = 0
}
EnableIpl(themeValue.ipl, false)
end
end
},
Safe = {
doorHeadingL = 126.0, -- Only need the heading of the Left door to get the Right ones
Position = vector3(-1554.08, -573.7122, 108.5272), -- Approximately between the two doors
-- These values are checked from "doorHandler.lua" and
isLeftDoorOpen = false,
isRightDoorOpen = false,
-- Safe door API
Open = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice3.Safe.isLeftDoorOpen = true
elseif doorSide:lower() == "right" then
FinanceOffice3.Safe.isRightDoorOpen = true
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice3.Safe.isLeftDoorOpen = false
elseif doorSide:lower() == "right" then
FinanceOffice3.Safe.isRightDoorOpen = false
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
-- Internal use only
SetDoorState = function(doorSide, open)
local doorHandle = 0
local heading = FinanceOffice3.Safe.doorHeadingL
if doorSide:lower() == "left" then
doorHandle = FinanceOffice3.Safe.GetDoorHandle(FinanceOffice3.currentSafeDoors.hashL)
if open then
heading = heading - 90.0
end
elseif doorSide:lower() == "right" then
doorHandle = FinanceOffice3.Safe.GetDoorHandle(FinanceOffice3.currentSafeDoors.hashR)
heading = heading - 180
if open then
heading = heading + 90.0
end
end
if doorHandle == 0 then
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end
SetEntityHeading(doorHandle, heading)
end,
-- /!\ handle changes whenever the interior is refreshed /!\
GetDoorHandle = function(doorHash)
local timeout = 4
local doorHandle = GetClosestObjectOfType(FinanceOffice3.Safe.Position.x, FinanceOffice3.Safe.Position.y, FinanceOffice3.Safe.Position.z, 5.0, doorHash, false, false, false)
while doorHandle == 0 do
Wait(25)
doorHandle = GetClosestObjectOfType(FinanceOffice3.Safe.Position.x, FinanceOffice3.Safe.Position.y, FinanceOffice3.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
if timeout <= 0 then
break
end
end
return doorHandle
end
},
Swag = {
Cash = {
A = "cash_set_01",
B = "cash_set_02",
C = "cash_set_03",
D = "cash_set_04",
E = "cash_set_05",
F = "cash_set_06",
G = "cash_set_07",
H = "cash_set_08",
I = "cash_set_09",
J = "cash_set_10",
K = "cash_set_11",
L = "cash_set_12",
M = "cash_set_13",
N = "cash_set_14",
O = "cash_set_15",
P = "cash_set_16",
Q = "cash_set_17",
R = "cash_set_18",
S = "cash_set_19",
T = "cash_set_20",
U = "cash_set_21",
V = "cash_set_22",
W = "cash_set_23",
X = "cash_set_24"
},
BoozeCigs = {
A = "swag_booze_cigs",
B = "swag_booze_cigs2",
C = "swag_booze_cigs3"
},
Counterfeit = {
A = "swag_counterfeit",
B = "swag_counterfeit2",
C = "swag_counterfeit3"
},
DrugBags = {
A = "swag_drugbags",
B = "swag_drugbags2",
C = "swag_drugbags3"
},
DrugStatue = {
A = "swag_drugstatue",
B = "swag_drugstatue2",
C = "swag_drugstatue3"
},
Electronic = {
A = "swag_electronic",
B = "swag_electronic2",
C = "swag_electronic3"
},
FurCoats = {
A = "swag_furcoats",
B = "swag_furcoats2",
C = "swag_furcoats3"
},
Gems = {
A = "swag_gems",
B = "swag_gems2",
C = "swag_gems3"
},
Guns = {
A = "swag_guns",
B = "swag_guns2",
C = "swag_guns3"
},
Ivory = {
A = "swag_ivory",
B = "swag_ivory2",
C = "swag_ivory3"
},
Jewel = {
A = "swag_jewelwatch",
B = "swag_jewelwatch2",
C = "swag_jewelwatch3"
},
Med = {
A = "swag_med",
B = "swag_med2",
C = "swag_med3"
},
Painting = {
A = "swag_art",
B = "swag_art2",
C = "swag_art3"
},
Pills = {
A = "swag_pills",
B = "swag_pills2",
C = "swag_pills3"
},
Silver = {
A = "swag_silver",
B = "swag_silver2",
C = "swag_silver3"
},
Enable = function(details, state, refresh)
SetIplPropState(FinanceOffice3.currentInteriorId, details, state, refresh)
end
},
Chairs = {
off = "",
on = "office_chairs",
Set = function(chairs, refresh)
FinanceOffice3.Chairs.Clear(false)
if chairs ~= nil then
SetIplPropState(FinanceOffice3.currentInteriorId, chairs, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice3.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice3.currentInteriorId, FinanceOffice3.Chairs.on, false, refresh)
end
},
Booze = {
off = "",
on = "office_booze",
Set = function(booze, refresh)
FinanceOffice3.Booze.Clear(false)
if booze ~= nil then
SetIplPropState(FinanceOffice3.currentInteriorId, booze, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice3.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice3.currentInteriorId, FinanceOffice3.Booze.on, false, refresh)
end
},
LoadDefault = function()
FinanceOffice3.Style.Set(FinanceOffice3.Style.Theme.conservative)
FinanceOffice3.Chairs.Set(FinanceOffice3.Chairs.on, true)
end
}

View file

@ -0,0 +1,324 @@
-- Office 4: -1392.667, -480.4736, 72.04217 (Maze Bank West)
exports('GetFinanceOffice4Object', function()
return FinanceOffice4
end)
FinanceOffice4 = {
currentInteriorId = -1,
currentSafeDoors = {
hashL = "",
hashR = ""
},
Style = {
Theme = {
warm = {
interiorId = 243201,
ipl = "ex_sm_15_office_01a",
safe = "ex_prop_safedoor_office1a"
},
classical = {
interiorId = 243457,
ipl = "ex_sm_15_office_01b",
safe = "ex_prop_safedoor_office1b"
},
vintage = {
interiorId = 243713,
ipl = "ex_sm_15_office_01c",
safe = "ex_prop_safedoor_office1c"
},
contrast = {
interiorId = 243969,
ipl = "ex_sm_15_office_02a",
safe = "ex_prop_safedoor_office2a"
},
rich = {
interiorId = 244225,
ipl = "ex_sm_15_office_02b",
safe = "ex_prop_safedoor_office2a"
},
cool = {
interiorId = 244481,
ipl = "ex_sm_15_office_02c",
safe = "ex_prop_safedoor_office2a"
},
ice = {
interiorId = 244737,
ipl = "ex_sm_15_office_03a",
safe = "ex_prop_safedoor_office3a"
},
conservative = {
interiorId = 244993,
ipl = "ex_sm_15_office_03b",
safe = "ex_prop_safedoor_office3a"
},
polished = {
interiorId = 245249,
ipl = "ex_sm_15_office_03c",
safe = "ex_prop_safedoor_office3c"
}
},
Set = function(style, refresh)
if refresh == nil then
refresh = false
end
if type(style) == "table" then
FinanceOffice4.Style.Clear()
FinanceOffice4.currentInteriorId = style.interiorId
FinanceOffice4.currentSafeDoors = {
hashL = GetHashKey(style.safe .. "_l"),
hashR = GetHashKey(style.safe .. "_r")
}
EnableIpl(style.ipl, true)
if refresh then
RefreshInterior(style.interiorId)
end
end
end,
Clear = function()
for themeKey, themeValue in pairs(FinanceOffice4.Style.Theme) do
for swagKey, swagValue in pairs(FinanceOffice4.Swag) do
if type(swagValue) == "table" then
SetIplPropState(themeValue.interiorId, {
swagValue.A,
swagValue.B,
swagValue.C
}, false)
end
end
SetIplPropState(themeValue.interiorId, "office_chairs", false, false)
SetIplPropState(themeValue.interiorId, "office_booze", false, true)
FinanceOffice4.currentSafeDoors = {
hashL = 0,
hashR = 0
}
EnableIpl(themeValue.ipl, false)
end
end
},
Safe = {
doorHeadingL = 188.0, -- Only need the heading of the Left door to get the Right ones
Position = vector3(-1372.905, -462.08, 72.05), -- Approximately between the two doors
-- These values are checked from "doorHandler.lua" and
isLeftDoorOpen = false,
isRightDoorOpen = false,
-- Safe door API
Open = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice4.Safe.isLeftDoorOpen = true
elseif doorSide:lower() == "right" then
FinanceOffice4.Safe.isRightDoorOpen = true
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
if doorSide:lower() == "left" then
FinanceOffice4.Safe.isLeftDoorOpen = false
elseif doorSide:lower() == "right" then
FinanceOffice4.Safe.isRightDoorOpen = false
else
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
-- Internal use only
SetDoorState = function(doorSide, open)
local doorHandle = 0
local heading = FinanceOffice4.Safe.doorHeadingL
if doorSide:lower() == "left" then
doorHandle = FinanceOffice4.Safe.GetDoorHandle(FinanceOffice4.currentSafeDoors.hashL)
if open then
heading = heading - 90.0
end
elseif doorSide:lower() == "right" then
doorHandle = FinanceOffice4.Safe.GetDoorHandle(FinanceOffice4.currentSafeDoors.hashR)
heading = heading - 180
if open then
heading = heading + 90.0
end
end
if doorHandle == 0 then
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end
SetEntityHeading(doorHandle, heading)
end,
-- /!\ handle changes whenever the interior is refreshed /!\
GetDoorHandle = function(doorHash)
local timeout = 4
local doorHandle = GetClosestObjectOfType(FinanceOffice4.Safe.Position.x, FinanceOffice4.Safe.Position.y, FinanceOffice4.Safe.Position.z, 5.0, doorHash, false, false, false)
while doorHandle == 0 do
Wait(25)
doorHandle = GetClosestObjectOfType(FinanceOffice4.Safe.Position.x, FinanceOffice4.Safe.Position.y, FinanceOffice4.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
if timeout <= 0 then
break
end
end
return doorHandle
end
},
Swag = {
Cash = {
A = "cash_set_01",
B = "cash_set_02",
C = "cash_set_03",
D = "cash_set_04",
E = "cash_set_05",
F = "cash_set_06",
G = "cash_set_07",
H = "cash_set_08",
I = "cash_set_09",
J = "cash_set_10",
K = "cash_set_11",
L = "cash_set_12",
M = "cash_set_13",
N = "cash_set_14",
O = "cash_set_15",
P = "cash_set_16",
Q = "cash_set_17",
R = "cash_set_18",
S = "cash_set_19",
T = "cash_set_20",
U = "cash_set_21",
V = "cash_set_22",
W = "cash_set_23",
X = "cash_set_24"
},
BoozeCigs = {
A = "swag_booze_cigs",
B = "swag_booze_cigs2",
C = "swag_booze_cigs3"
},
Counterfeit = {
A = "swag_counterfeit",
B = "swag_counterfeit2",
C = "swag_counterfeit3"
},
DrugBags = {
A = "swag_drugbags",
B = "swag_drugbags2",
C = "swag_drugbags3"
},
DrugStatue = {
A = "swag_drugstatue",
B = "swag_drugstatue2",
C = "swag_drugstatue3"
},
Electronic = {
A = "swag_electronic",
B = "swag_electronic2",
C = "swag_electronic3"
},
FurCoats = {
A = "swag_furcoats",
B = "swag_furcoats2",
C = "swag_furcoats3"
},
Gems = {
A = "swag_gems",
B = "swag_gems2",
C = "swag_gems3"
},
Guns = {
A = "swag_guns",
B = "swag_guns2",
C = "swag_guns3"
},
Ivory = {
A = "swag_ivory",
B = "swag_ivory2",
C = "swag_ivory3"
},
Jewel = {
A = "swag_jewelwatch",
B = "swag_jewelwatch2",
C = "swag_jewelwatch3"
},
Med = {
A = "swag_med",
B = "swag_med2",
C = "swag_med3"
},
Painting = {
A = "swag_art",
B = "swag_art2",
C = "swag_art3"
},
Pills = {
A = "swag_pills",
B = "swag_pills2",
C = "swag_pills3"
},
Silver = {
A = "swag_silver",
B = "swag_silver2",
C = "swag_silver3"
},
Enable = function(details, state, refresh)
SetIplPropState(FinanceOffice4.currentInteriorId, details, state, refresh)
end
},
Chairs = {
off = "",
on = "office_chairs",
Set = function(chairs, refresh)
FinanceOffice4.Chairs.Clear(false)
if chairs ~= nil then
SetIplPropState(FinanceOffice4.currentInteriorId, chairs, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice4.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice4.currentInteriorId, FinanceOffice4.Chairs.on, false, refresh)
end
},
Booze = {
off = "",
on = "office_booze",
Set = function(booze, refresh)
FinanceOffice4.Booze.Clear(false)
if booze ~= nil then
SetIplPropState(FinanceOffice4.currentInteriorId, booze, true, refresh)
else
if refresh then
RefreshInterior(FinanceOffice4.currentInteriorId)
end
end
end,
Clear = function(refresh)
SetIplPropState(FinanceOffice4.currentInteriorId, FinanceOffice4.Booze.on, false, refresh)
end
},
LoadDefault = function()
FinanceOffice4.Style.Set(FinanceOffice4.Style.Theme.cool)
FinanceOffice4.Chairs.Set(FinanceOffice4.Chairs.on, true)
end
}

View file

@ -0,0 +1,162 @@
exports('GetFinanceOrganizationObject', function()
return FinanceOrganization
end)
AddEventHandler('onClientResourceStop', function(res)
if GetCurrentResourceName() ~= res then
return
end
FinanceOrganization.Office.Clear()
end)
FinanceOrganization = {
Name = {
Colors = {
black = 0,
gray = 1,
yellow = 2,
blue = 3,
orange = 5,
red = 6,
green = 7
},
Fonts = {
font1 = 0,
font2 = 1,
font3 = 2,
font4 = 3,
font5 = 4,
font6 = 5,
font7 = 6,
font8 = 7,
font9 = 8,
font10 = 9,
font11 = 10,
font12 = 11,
font13 = 12
},
Style = {
normal = 3,
light = 1
},
name = "",
style = 0,
color = 0,
font = 0,
Set = function(name, style, color, font)
FinanceOrganization.Name.name = name
FinanceOrganization.Name.style = style
FinanceOrganization.Name.color = color
FinanceOrganization.Name.font = font
FinanceOrganization.Office.stage = 0
end
},
Office = {
needToLoad = false,
loaded = false,
target = "prop_ex_office_text",
prop = "ex_prop_ex_office_text",
renderId = -1,
movieId = -1,
stage = 0,
Init = function()
DrawEmptyRect(FinanceOrganization.Office.target, FinanceOrganization.Office.prop)
end,
Enable = function(state)
FinanceOrganization.Office.needToLoad = state
end,
Clear = function()
if IsNamedRendertargetRegistered(FinanceOrganization.Office.target) then
ReleaseNamedRendertarget(GetHashKey(FinanceOrganization.Office.target))
end
if HasScaleformMovieFilenameLoaded(FinanceOrganization.Office.movieId) then
SetScaleformMovieAsNoLongerNeeded(FinanceOrganization.Office.movieId)
end
FinanceOrganization.Office.renderId = -1
FinanceOrganization.Office.movieId = -1
FinanceOrganization.Office.stage = 0
end
}
}
CreateThread(function()
FinanceOrganization.Office.Init()
while true do
if FinanceOrganization.Office.needToLoad then
-- Need to load
if Global.FinanceOffices.isInsideOffice1 or Global.FinanceOffices.isInsideOffice2 or Global.FinanceOffices.isInsideOffice3 or Global.FinanceOffices.isInsideOffice4 then
DrawOrganizationName(FinanceOrganization.Name.name, FinanceOrganization.Name.style, FinanceOrganization.Name.color, FinanceOrganization.Name.font)
FinanceOrganization.Office.loaded = true
Wait(0) -- We need to call all this every frame
else
Wait(1000) -- We are not inside an office
end
elseif FinanceOrganization.Office.loaded then
-- Loaded and need to unload
FinanceOrganization.Office.Clear()
FinanceOrganization.Office.loaded = false
Wait(1000) -- We can wait longer when we don't need to display text
else
-- Not needed to load
Wait(1000) -- We can wait longer when we don't need to display text
end
end
end)
function DrawOrganizationName(name, style, color, font)
if FinanceOrganization.Office.stage == 0 then
if FinanceOrganization.Office.renderId == -1 then
FinanceOrganization.Office.renderId = CreateNamedRenderTargetForModel(FinanceOrganization.Office.target, FinanceOrganization.Office.prop)
end
if FinanceOrganization.Office.movieId == -1 then
FinanceOrganization.Office.movieId = RequestScaleformMovie("ORGANISATION_NAME")
end
FinanceOrganization.Office.stage = 1
elseif FinanceOrganization.Office.stage == 1 then
if HasScaleformMovieLoaded(FinanceOrganization.Office.movieId) then
local parameters = {
p0 = {
type = "string",
value = name
},
p1 = {
type = "int",
value = style
},
p2 = {
type = "int",
value = color
},
p3 = {
type = "int",
value = font
}
}
SetupScaleform(FinanceOrganization.Office.movieId, "SET_ORGANISATION_NAME", parameters)
FinanceOrganization.Office.stage = 2
else
FinanceOrganization.Office.movieId = RequestScaleformMovie("ORGANISATION_NAME")
end
elseif FinanceOrganization.Office.stage == 2 then
SetTextRenderId(FinanceOrganization.Office.renderId)
SetScriptGfxDrawOrder(4)
SetScriptGfxDrawBehindPausemenu(true)
SetScriptGfxAlign(73, 73)
DrawScaleformMovie(FinanceOrganization.Office.movieId, 0.196, 0.245, 0.46, 0.66, 255, 255, 255, 255, 0)
SetTextRenderId(GetDefaultScriptRendertargetRenderId())
ResetScriptGfxAlign()
end
end