๐Ÿ“ฆLooting System

Table of Contents

Overview

Hate Looting is an advanced looting system for FiveM servers that supports both QBCore and ESX frameworks. It provides a comprehensive solution for searching objects, looting NPCs, and managing inventory with advanced clothing metadata generation and Discord logging integration.

Key Highlights

  • Dual Framework Support: Works with both QBCore and ESX

  • Advanced Clothing System: Automatic metadata generation with blacklist support

  • Multiple UI Options: Built-in UI or core_inventory integration

  • Discord Integration: Rich logging with inventory images

  • Performance Optimized: Client-side detection and caching systems

  • Highly Configurable: Extensive configuration options

Features

Core Features

  • Object Looting: Search various props and objects in the game world

  • NPC/Animal Looting: Loot zombies, animals, and other NPCs

  • Progress Bar Integration: Support for multiple progress bar systems

  • Target System: Integration with ox_target, qb-target, and qtarget

  • Inventory Integration: Works with ox_inventory and core_inventory

  • Anti-Exploit: Distance checks and search state management

Advanced Features

  • Clothing Metadata System: Automatic generation of clothing metadata for core_inventory

  • Client-Side Detection: Dynamic max value detection for clothing variations

  • Blacklist System: Exclude specific clothing models from generation

  • Unique Item Identification: Prevents UI selection issues with duplicate items

  • Discord Logging: Rich webhook logging with inventory images

  • Loot Zones: Configurable loot increase/decrease zones

  • Item Requirements: Require specific items or weapons for certain loot types

UI Features

  • Dual UI System: Choose between built-in UI or core_inventory

  • Responsive Design: Mobile-friendly interface

  • Sound Effects: Audio feedback for looting actions

  • Visual Feedback: Progress indicators and animations

  • Inventory Images: Display item images from inventory system

Installation

Requirements

  • Framework: QBCore or ESX

  • Dependencies (Optional):

    • ox_lib

    • mythic_progbar / esx_progressbar

    • ox_target / qb-target / qtarget

    • ox_inventory / core_inventory

Steps

  1. Download: Extract hate-looting to your resources folder

  2. Server Config: Add ensure hate-looting to your server.cfg

  3. Framework Detection: The script auto-detects your framework

  4. Configure: Edit configuration files as needed

  5. Start Server: Restart your server

Configuration

Main Config (config.lua)

Basic Settings

UI Configuration

Clothing Configuration (clothing_config.lua)

Clothing Metadata System

Clothing Item Configuration

Blacklist System

Torso Mappings

The script includes comprehensive torso mappings for proper clothing compatibility:

Loot Rewards Configuration

Loot Tables

Lootable Objects

Animal/NPC Loot Types

Advanced Configuration

Loot Zones

Item/Weapon Requirements

Progress Bar Animations

Clothing System

Overview

The clothing system automatically generates metadata for clothing items when using core_inventory, ensuring compatibility with clothing systems.

Features

  • Auto-Detection: Automatically detects maximum model and texture variations

  • Blacklist Support: Exclude problematic clothing models

  • Gender Support: Separate configurations for male/female characters

  • Torso Mapping: Proper torso compatibility for clothing items

  • Caching System: Client-side caching for performance optimization

Configuration Examples

Basic Clothing Item

Prop Item (Hat/Glasses)

Blacklisting Models

Metadata Generation

The system generates metadata in the following format:

Framework Support

Unified Framework System

The script uses a unified framework file (server/framework_unified.lua) that supports both QBCore and ESX with automatic detection.

Auto-Detection

Framework Functions

The unified system provides consistent functions:

  • GetPlayerFromId(src) - Get player object

  • AddInventoryItem(player, item, count, metadata) - Add item to inventory

  • RemoveInventoryItem(player, item, count) - Remove item from inventory

  • HasEnoughtInventoryItem(player, item, count) - Check item availability

  • GetItemLabel(item) - Get item display name

  • ShowNotification(src, message) - Send notification

UI Systems

Built-in UI System

The script includes a custom HTML/CSS/JavaScript UI with the following features:

Features

  • Responsive Design: Works on all screen sizes

  • Sound Effects: Audio feedback for actions

  • Animations: Smooth transitions and effects

  • Item Images: Display inventory item images

  • Drag and Drop: Interactive item management

Customization

The UI can be customized by editing files in the html/ folder:

  • nui.html - HTML structure

  • app.js - JavaScript functionality

  • Sound files for audio feedback

Core Inventory Integration

When using core_inventory, the script integrates seamlessly:

Features:

  • Advanced Loot Interface: Uses core_inventory's openLootAdvanced

  • Metadata Support: Full metadata preservation

  • Inventory Management: Integrated with core_inventory systems

Logging System

Discord Webhook Integration

The script includes comprehensive Discord logging with the following features:

Log Types

  • Loot Events: When players loot items

  • Admin Actions: Administrative activities

  • Error Logging: System errors and issues

Configuration (logs.lua)

Features

  • Rich Embeds: Detailed Discord embeds with colors and fields

  • Item Images: Display inventory item images in logs

  • Metadata Logging: Log item metadata for debugging

  • Player Information: Include player details and coordinates

  • Timestamp Support: Automatic timestamp generation

Example Log Entry

API Reference

Server Events

Core Events

Clothing System Events

Client Events

UI Events

Server Functions

Clothing Functions

Utility Functions

Client Functions

Clothing Detection

UI Management

Troubleshooting

Common Issues

1. Clothing Metadata Not Working

Problem: Clothing items don't have proper metadata Solution:

  • Ensure Config.useCoreMetadataClothes = true

  • Verify core_inventory is installed and working

  • Check if clothing items are properly configured in clothing_config.lua

2. UI Not Showing

Problem: Loot UI doesn't appear Solution:

  • Check Config.UseUIType setting

  • Verify NUI resource is properly started

  • Check for JavaScript errors in console (F8)

3. Framework Detection Issues

Problem: Script doesn't detect framework Solution:

  • Ensure framework resource is started before hate-looting

  • Check framework resource names match expected names

  • Verify framework is properly installed

4. Loot Not Refreshing

Problem: Loot locations don't refresh Solution:

  • Check Config.lootRefreshTime and Config.emptyLootRefreshTime

  • Verify server isn't restarting before refresh time

  • Check for errors in server console

5. Distance/Target Issues

Problem: Can't target objects or distance issues Solution:

  • Adjust Config.TargetDistance

  • Check target system integration (ox_target, qb-target)

  • Verify Config.DistanceCheckProtection isn't too restrictive

Debug Mode

Enable debug mode for troubleshooting:

This will provide console output for:

  • Loot generation processes

  • Clothing metadata generation

  • Framework detection

  • Target system interactions

Performance Optimization

Client-Side Caching

The script uses client-side caching for clothing max values to reduce server load:

  • Cache duration: 5 minutes

  • Automatic cache refresh

  • Fallback to config values if detection fails

Server-Side Optimization

  • Unified framework system reduces code duplication

  • Efficient loot generation algorithms

  • Optimized database queries (if applicable)

Error Logging

The script includes comprehensive error logging:

  • Server console errors

  • Client console errors (when debug enabled)

  • Discord webhook error notifications

  • Fallback systems for critical failures

Support

For additional support:

  1. Check this documentation first

  2. Enable debug mode to identify issues

  3. Check server/client console for errors

  4. Verify all dependencies are properly installed

  5. Ensure proper configuration of all systems


This documentation covers the complete feature set of Hate Looting. For the most up-to-date information, always refer to the latest version of this documentation.

Last updated