newsrack.lua
The complete default newsrack.lua for Petty Crime (sd-pettycrime). Use this as a reference or a starting point for your own configuration.
TIP
This is the full, unedited config file. For a detailed explanation of each option, see the Configuration page.
lua
return {
Cooldown = 3, -- Per-rack cooldown (in minutes) before the same coin tray can be cracked again.
Items = { 'screwdriver', 'multitool' }, -- Tools (any one is enough)
Time = 8, -- Seconds for the loot progress bar.
BaseXP = 6, -- Base XP awarded for a successful raid.
GiveXPForCash = true, -- 1 XP per $ collected on top of BaseXP.
Logging = true,
-- World-prop model names ox_target attaches our option to. Newspaper
-- racks are scattered all over the GTA V map — sidewalks outside
-- 24/7s, gas stations, transit stops, suburban corners. addModel does
-- the rest, no spawning required.
Models = {
'prop_news_disp_01a',
'prop_news_disp_02a',
'prop_news_disp_02b',
'prop_news_disp_02c',
'prop_news_disp_02d',
'prop_news_disp_02e',
'prop_news_disp_03a',
'prop_news_disp_03c',
'prop_news_disp_05a',
'prop_news_disp_06a',
'prop_news_disp_06b',
'prop_news_disp_06c',
'prop_news_disp_06d',
'prop_news_disp_06e',
},
Minigame = {
Enable = true,
Start = function()
-- Runs a built-in minigame and returns pass/fail. Swap `dial` for
-- any other minigame.* (see client/minigame.lua for the full list)
-- or your own function that returns true/false. Tune below.
return require('client.minigame').dial({
notches = 4, -- notches to crack in order
hitWindowDeg = 24, -- hit tolerance in degrees
rotationSpeedDegSec = 170, -- hand speed (deg/sec)
speedUpMultiplier = 1.08, -- speed-up after each notch
timeLimitSec = 10, -- seconds before caught; 0 = none
}).success
end,
},
PoliceAlert = {
Enable = true,
Chance = 18, -- Lower than parking meters — newsracks are tinier targets.
Send = function()
local alertMessage = 'Newsrack tampering reported'
print('Police Alert: ' .. alertMessage)
-- Example: cd_dispatch integration (uncomment to use)
--[[
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'police'},
coords = data.coords,
title = '10-15 - Vandalism',
message = ('A %s tampering with a newspaper rack at %s'):format(data.sex, data.street),
flash = 0,
unique_id = data.unique_id,
sound = 1,
blip = {
sprite = 431,
scale = 1.1,
colour = 3,
flashes = false,
text = '911 - Vandalism',
time = 5,
radius = 0,
}
})
--]]
end,
},
-- Per-level cash payout — small change, scaling with player level.
Rewards = {
[1] = { min = 2, max = 8 }, -- Level 1
[2] = { min = 6, max = 14 }, -- Level 2
[3] = { min = 10, max = 22 }, -- Level 3
},
}