BROKE PROTOCOL

BROKE PROTOCOL

61 ratings
Advanced Police
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
29.184 KB
30 Apr, 2021 @ 6:28am
26 Jul @ 9:15am
12 Change Notes ( view )

Subscribe to download
Advanced Police

Description
Advanced Police

THIS PLUGIN REQUIRES Life Events!

Make law enforcement jobs better!
Gives access to a police menu to fine a player or report a crime. The plugin is 100% compatible with the Identity Plugin and detects its presence to use these names.

Also adds the possibility to disable default crimes to let the police manage all the crimes.
Last but not least, the plugin has custom registered events you can trigger and subscribe to. Check all the events at the end.

ATTENTION! by default the cops-only mode is deactivated. Which mean anybody with the permission can use the police menu command.

Commands
The permissions prefix is: ap

Command: /tickets
Description: Watch your tickets and pay the fines
Permission: ap.tickets

Command: /policemenu
Description: Access the police menu to manage fines and crimes
Permission: ap.policemenu

Command: /defaultcrimes
Description: Activate or deactivate default crimes
Permission: ap.defaultcrimes

Command: /copsonly
Description: Toggle the cops-only mode access to commands (usefull if you don't use custom groups for cops)
Permission: ap.copsonly

Command: /policemenu
Description: Access police menu command without being law enforcement
Permission: ap.admin

Command: /policereload
Description: Reloads localization file
Permission: ap.policereload

Localization
Most of the plugin is translatable in Plugins\settings\AdvancedPolice.json

Events
Events that can be triggered or listened

Event: UnisharkPoliceActions
Parameters: ShEntity entity, ShPlayer player
Default Behavior: Opens the police menu (used for entity actions)

Event: UnisharkShowRecords
Parameters: ShEntity entity, ShPlayer player
Default Behavior: Opens criminal records for crimes (used for entity actions)

Event: UnisharkShowFines
Parameters: ShEntity entity, ShPlayer player
Default Behavior: Opens criminal records for tickets (used for entity actions)

Event: UnisharkActionAddTicket
Parameters: ShEntity entity, ShPlayer player
Default Behavior: Create a new ticket with the UI (used for entity actions)

Event: UnisharkActionAddCrime
Parameters: ShEntity entity, ShPlayer player
Default Behavior: Report a crime with the UI (used for entity actions)

Event: UnisharkAddTicket
Parameters: ShPlayer issuer, string issuerName, ShPlayer target, string targetName, string ticketReason, int fineValue
Default Behavior: Logs when a ticket is added

Event: UnisharkRemoveTicket
Parameters: ShPlayer issuer, string issuerName, ShPlayer target, string targetName, string ticketReason, int fineValue
Default Behavior: Logs when a ticket is removed

Event: UnisharkPayFine
Parameters: ShPlayer issuer, string issuerName, ShPlayer target, string targetName, string ticketReason, int fineValue
Default Behavior: Logs when a player pays a fine

Event: UnisharkAddCrime
Parameters: ShPlayer issuer, string issuerName, ShPlayer target, string targetName, Crime crime
Default Behavior: Logs when a crime is added

Use the entity actions events
Entity actions events checks if the first parameter is different from the caller, if it's null or they are the same, the event is called

If it's a different entity it checks if the entity have access to the police functionalities (if the entity data is "police")
If the entity have access to that, then it checks if the cops-only mod is activated or not to trigger the action or not.

Be careful! If the cops-only mode is deactivated, anybody can access the police menu from your custom entity action. Make sure the put in a secure place!
8 Comments
LifeBP 15 Mar @ 1:59pm 
a older version of advenced police work with modspawner but this new version cause error with modspawner
LosCartuchos5566 19 Jan, 2024 @ 7:47pm 
exivisionism (skull emoji)
i am bad writing some word in english
Myst Leissa 19 Jun, 2023 @ 4:00pm 
@Maroon_TheFox - I believe you need to set the permissions, make sure you didn't use TAB indentation in your groups.json (why this doesn't work is beyond me)
M.Propre 6 Jun, 2023 @ 7:22am 
damn i remind when the computer not available, few day ago i think i probably need recreate the mod and now i see u add it xD u insane
Maroon_TheFox 5 Jan, 2022 @ 7:07pm 
Ho do i exactly activate it? When i'll type /policemenu, it'll show me "No permission" message. I gave myself admin. Or how do i do it? :bpspecops:
TheUnishark  [author] 11 Aug, 2021 @ 6:27am 
Yes, as long as you configure your groups
Davidziak 11 Aug, 2021 @ 5:48am 
Is it working in offline?
SploeCyber 30 Apr, 2021 @ 8:36pm 
Very useful :clowney: