Skip to content

Commit b73c09e

Browse files
committed
Added Support for Object Gizmo
Dispatch Compatibility: OP-Dispatch Notification Compatibility: Brutal and Mythic
1 parent 748987b commit b73c09e

3 files changed

Lines changed: 68 additions & 10 deletions

File tree

client/main.lua

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,37 @@ local function PlaceItem(itemType)
6666
SetEntityAlpha(obj, 150, false)
6767
SetEntityCollision(obj, false, false)
6868
SetEntityAsMissionEntity(obj, true, true)
69+
if Config.UseObjectGizmo then
70+
exports.object_gizmo:useGizmo(obj)
71+
FreezeEntityPosition(obj, true)
72+
SetEntityAlpha(obj, 255, false)
73+
SetEntityCollision(obj, true, true)
74+
placedObjects[itemType] = obj
75+
76+
if itemType == Config.Items.generator then
77+
local generatorCoords = GetEntityCoords(obj)
78+
lib.zones.box({
79+
coords = generatorCoords,
80+
size = vec3(2.0, 2.0, 2.0),
81+
rotation = 0,
82+
debug = false,
83+
onEnter = function()
84+
local percentage = math.floor((generatorFuel / Config.RequiredFuel) * 100)
85+
currentFuelText = lib.showTextUI("Fuel: " .. percentage .. "%")
86+
end,
87+
onExit = function()
88+
lib.hideTextUI()
89+
currentFuelText = nil
90+
end,
91+
})
92+
end
93+
94+
if itemType == Config.Items.laptop or itemType == Config.Items.generator or itemType == Config.Items.printer then
95+
Framework_AddTargetToEntity(obj, itemType)
96+
end
97+
TriggerEvent("pl_fraud:notification",locale("itemPlaced", itemType), "success")
98+
SetModelAsNoLongerNeeded(model)
99+
else
69100
local heading = GetEntityHeading(obj)
70101
local zOffset = 0.0
71102

@@ -133,6 +164,7 @@ local function PlaceItem(itemType)
133164
end
134165
end
135166
end)
167+
end
136168
end
137169

138170

@@ -539,6 +571,22 @@ function DispatchAlert()
539571
}
540572
TriggerServerEvent('rcore_dispatch:server:sendAlert', alert)
541573
end)
574+
elseif Config.Dispatch.script == 'op' then
575+
local ped = PlayerPedId()
576+
local coords = GetEntityCoords(ped)
577+
local street1, street2 = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
578+
local street1name = GetStreetNameFromHashKey(street1)
579+
local street2name = GetStreetNameFromHashKey(street2)
580+
581+
local job = Config.Police.Job -- Jobs that will receive the alert
582+
local title = "Card Cloning" -- Main title alert
583+
local id = GetPlayerServerId(PlayerId()) -- Player that triggered the alert
584+
local panic = false -- Allow/Disable panic effect
585+
586+
local locationText = street2name and (street1name .. " and " .. street2name) or street1name
587+
local text = "Card Cloning Activity Reported in progress on " .. locationText -- Main text alert
588+
589+
TriggerServerEvent('Opto_dispatch:Server:SendAlert', job, title, text, coords, panic, id)
542590
elseif Config.Dispatch.script == 'custom' then
543591

544592
end
@@ -581,7 +629,11 @@ AddEventHandler('pl_fraud:notification', function(message, type)
581629
elseif Config.Notify == 'qb' then
582630
TriggerEvent("QBCore:Notify", message, type, 6000)
583631
elseif Config.Notify == 'wasabi' then
584-
exports.wasabi_notify:notify("ATM ROBBERY", message, 6000, type, false, 'fas fa-ghost')
632+
exports.wasabi_notify:notify("Fraud Script", message, 6000, type, false, 'fas fa-ghost')
633+
elseif Config.Notify == 'brutal_notify' then
634+
exports['brutal_notify']:SendAlert('Notify', message, 6000, type, false)
635+
elseif Config.Notify == 'mythic_notify' then
636+
exports['mythic_notify']:SendAlert(type, message)
585637
elseif Config.Notify == 'custom' then
586638
-- Add your custom notifications here
587639
end
@@ -596,4 +648,3 @@ AddEventHandler('onResourceStop', function(resourceName)
596648
end
597649
end)
598650

599-

config.lua

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Config = {}
44

55
Config.Debug = false -- Set to true to enable debug messages
66

7-
Config.Target = 'ox-target' --qb-target, ox-target
7+
Config.UseObjectGizmo = false -- Set to true to use object gizmo for placing items Download: https://github.com/DemiAutomatic/object_gizmo
88

9-
Config.Notify = 'ox' --ox, esx, okok,qb,wasabi,custom
9+
Config.Target = 'ox-target' --'qb-target', 'ox-target'
10+
11+
Config.Notify = 'ox' --'ox', 'esx', 'okok','qb','wasabi','brutal_notify','mythic_notify','custom'
1012

1113
-- Item names (can be modified to match your server's item names)
1214
Config.Items = {
@@ -35,6 +37,10 @@ Config.Props = {
3537
generator = "prop_generator_01a"
3638
}
3739

40+
Config.Police= {
41+
Job = 'police', -- Job name for police
42+
}
43+
3844
Config.atmModels = {
3945
`prop_atm_01`,
4046
`prop_atm_02`,
@@ -61,14 +67,15 @@ Config.TargetOptions = {
6167
}
6268
}
6369

64-
--ps for ps-dispatch
65-
--aty for aty_disptach
66-
--qs for qausar dispatch
67-
--rcore for rcore dispatch
70+
--'ps' for ps-dispatch
71+
--'aty' for aty_disptach | Free https://github.com/atiysuu/aty_dispatch
72+
--'qs' for qausar dispatch
73+
--'rcore' for rcore dispatch
74+
--'op' for op-dispatch | Free https://github.com/ErrorMauw/op-dispatch
6875
--custom for your own
6976

7077
Config.Dispatch= {
7178
enable = false,
72-
script = 'ps'
79+
script = 'op'
7380
}
7481

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ game 'gta5'
33

44
author 'PulseScripts'
55
description 'Fraud Script'
6-
version '1.0.1'
6+
version '1.1.0'
77

88
shared_scripts {
99
'@ox_lib/init.lua',

0 commit comments

Comments
 (0)