โ›๏ธ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 player

  • amount = number of actions they must complete

You can also use a /command or add it into your arrest script logic.


๐Ÿ› ๏ธ How It Works

  1. The player is teleported to the community service area.

  2. A UI appears showing how many tasks remain.

  3. Tasks involve walking to a target and doing an animation (e.g. picking trash).

  4. After each action, the counter updates.

  5. 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