payphone.lua
The complete default payphone.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 = 2, -- Cooldown till a payphone is robbable again. (in minutes)
Items = { 'screwdriver', 'multitool' }, -- Tools (any one is enough) — used to pry the coin box.
Time = 10, -- Time in seconds to loot the payphone (progressbar time)
BaseXP = 12, -- Base XP awarded for successful payphone robbery
GiveXPForCash = true, -- Whether to give 1 XP per cash received
Models = { -- Models to add the target to.
"p_phonebox_02_s",
"prop_phonebox_03",
"prop_phonebox_02",
"prop_phonebox_04",
"prop_phonebox_01c",
"prop_phonebox_01a",
"prop_phonebox_01b",
"p_phonebox_01b_s",
},
Logging = true, -- Enables lib.logger usage for this action. Will log a players source, character name and identifier as well as the action they took and the items and cash they received from it.
Minigame = {
Enable = true, -- Enable/disable custom minigame (if false, no minigame will be used)
Start = function()
-- Runs a built-in minigame and returns pass/fail. Swap `sequence`
-- 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').sequence({
padCount = 4, -- number of pads
startLength = 3, -- sequence length to start at
maxLength = 6, -- grows to this; clearing it wins
growBy = 1, -- pads added each round
flashOnMs = 440, -- how long each pad lights (ms)
flashGapMs = 220, -- gap between pad flashes (ms)
timeLimitSec = 7, -- seconds per round; 0 = no limit
}).success
end,
},
PoliceAlert = {
Enable = true, -- Enable/disable police alerts for payphone robberies
Chance = 30, -- Percentage chance (0-100) that police will be alerted
--- @param coords, the coordinates of the player thats triggered the alert.
Send = function() -- Client Function
-- Custom function to send police alerts
-- You can integrate with your preferred dispatch system here
-- Basic Example
local alertMessage = "Payphone 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 = coords,
title = '10-15 - Vandalism',
message = 'A '..data.sex..' tampering with payphone at '..data.street,
flash = 0,
unique_id = data.unique_id,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Vandalism',
time = 5,
radius = 0,
}
})
--]]
end,
},
Rewards = { -- Level-based cash rewards from payphones
[1] = { -- Level 1 rewards (basic)
min = 4,
max = 15
},
[2] = { -- Level 2 rewards (improved)
min = 10,
max = 25
},
[3] = { -- Level 3 rewards (advanced)
min = 20,
max = 40
},
},
}