esx_kingofthehill
Group area capturing/defending. Made this for our roleplay server as a gang war mechanic (currently only supports one area of capture as that’s all we wanted) and decided to release it
Very quick demo of joining, starting and cancelling a capture due to leaving the area (with RequiredCapturersMin set to 1 for demo sake)
Requirements
- ESX (requires police and ambulance jobs if the BlockEmergencyServices config value is true in the config)
- esx_phone (for police dispatch messages)
Setup
- Run the db.sql file on your DB to create the 2 required tables (remove item insert if your item already exists)
- Put the mod in your resources folder and ensure it
How it works (with default settings)
- A group of minimum 3, maximum 5 join a capture group when in the area
- When ready, one member can start the capturing (neutral capture only takes 1 minute. Capturing when it is already owned by someone else, takes a specified time based on how many owners are online)
- If none of the existing owners are online, it cannot be captured
- A blue wall (opaque marker) shows the full area of capture
- During both the grouping and capturing stages, anyone that leaves the area of capture will be removed from the group or capture. The same applies if they die.
- If being captured, all current owners that are online will be notified and the capturers will be displayed as red skull blips on their maps during the entire capture process making it almost impossible for capturers to simply hide in bushes etc.
- A progress indicator of the capture will be visible to capturers and passerby’s
- Capturing is cancelled when all capturers are taken down or leave the area
- If the capture is successful, any survivors in the capturing group will be given a code to join the payroll as the new kings of the hill and all old owners are removed from payroll.
- Anyone can use the code, not just the capturers
- Police are notified via dispatch (esx_phone) at the beginning and end of the capturing, indicated as a turf war.
- A cooldown is set after a successful capture
- A reward item is given to current online owners which can be set in the config, as well as the amount given and the interval at which rewards are to be given (make sure whatever item is used as a reward exists in your items table in your DB)
Commands
/payroll join Attempt to join the capture group
/payroll leave Attempt to leave the capture group
/payroll start Start the capturing when group is ready
/payroll owners Displays the current amount of owners (online and offline total)
/payroll {code} Joins a player to the payroll if the code is valid
Git
Project Repo: esx_kingofthehill
Bugs & Feature Requests: Issues
Planned Updates
Multiple areas: Currently this mod only supports one area for capture (was all we needed for our server) - multi area support might come later
