โ๏ธCommunity Service System
The Community Service System offers an alternative punishment to jail time. Instead of serving a sentence behind bars, players can be assigned community tasks they must complete in the city or near the prison.
๐ฏ Purpose
This system is useful for:
Roleplay-friendly light punishments
Non-violent crime penalties
Reducing jail population
โ๏ธ Assigning Community Service
Officers (or scripts) can assign players using:
TriggerServerEvent('dynyx_prison:server:AssignCommunityService', targetId, amount)
targetId
= server ID of the playeramount
= number of actions they must complete
You can also use a /command
or add it into your arrest script logic.
๐ ๏ธ How It Works
The player is teleported to the community service area.
A UI appears showing how many tasks remain.
Tasks involve walking to a target and doing an animation (e.g. picking trash).
After each action, the counter updates.
Once the required amount is done, the player is released.
๐งพ Configuration Snippet
Config.CommunityService = {
ActionsRequired = 10,
Locations = {
vector3(1925.01, 4916.49, 47.08),
vector3(1928.14, 4913.02, 47.12),
-- Add more if needed
},
PedModel = `s_m_y_garbage`,
UsePed = true
}
You can adjust:
Number of actions required
Locations where actions happen
Whether to use a ped to assign/start service
๐ง Developer Tips
Want custom animations?
Edit client/communityservice.lua
to change the task animations.
Want a menu for cops to assign it?
Use lib.registerContext
or qb-menu
with the server event.
Want to reward or penalize players?
Add XP, cash, or logs on successful completion.
Last updated