Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ Aiben Starter Pack System

An advanced starter pack system for ESX Legacy FiveM servers that provides new players with customizable welcome rewards including cash, items, weapons, and vehicles.

Version FiveM ESX Legacy License


๐Ÿ“ธ Preview

Screenshot

Starter Pack System

Demo Video

Starter Pack System Demo


โœจ Features

  • Multiple Starter Pack Options - Players can choose between different starter pack types (Civilian, Criminal, etc.)
  • Customizable Rewards - Configure cash, items, weapons, and vehicles per pack
  • One-Claim System - Prevents abuse by allowing each player to claim only once
  • NPC Interaction - Easy-to-use NPC for players to interact with
  • Discord Logging - Automatic Discord webhook notifications when packs are claimed
  • ox_target Support - Optional integration with ox_target for better UX
  • Blip System - Mini-map marker for easy NPC location
  • MySQL Support - Uses oxmysql for efficient database operations
  • Player Tracking - Database tracking of claimed packs per identifier

๐Ÿ“‹ Requirements

Dependencies

This script requires the following resources to be installed on your FiveM server:

Server Version

  • FiveM Build: cerulean or higher
  • Game: GTA5
  • Framework: ESX Legacy

๐Ÿš€ Installation

Step 1: Download & Extract

  1. Download or clone this repository
  2. Extract the folder to your server's resources directory
  3. Rename the folder to [scripts] if needed (or use any naming convention)

Step 2: Database Setup

Run the following SQL query on your server database:

CREATE TABLE IF NOT EXISTS `starterpacks` (
    `identifier` varchar(60) NOT NULL,
    `claimed` tinyint(1) NOT NULL DEFAULT 1,
    `claimed_at` timestamp NOT NULL DEFAULT current_timestamp(),
    PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Step 3: Configuration

  1. Open config.lua
  2. Configure your settings (NPC location, starter packs, etc.)
  3. Add your Discord webhook URL (optional)

Step 4: Server.cfg

Add the following to your server.cfg:

ensure es_extended
ensure ox_lib
ensure ox_target
ensure oxmysql
ensure [scripts]

โš™๏ธ Configuration

Basic Configuration

Config = {}

-- Use ox_target for interactions (true) or DrawText3D + E key (false)
Config.UseTarget = false

-- Discord webhook for logging claims (set empty string to disable)
Config.DiscordWebhook = "YOUR_WEBHOOK_URL_HERE"

Blip Configuration

Config.Blip = {
    Enabled = true,
    Sprite = 587,
    Color = 3,
    Scale = 0.8,
    Name = "Starter Pack"
}

NPC Configuration

Config.NPC = {
    Model = "a_m_y_business_03",
    Coords = vector4(-1039.1547, -2732.2444, 20.1692, 237.3990) -- Airport location
}

Starter Pack Configuration

Each starter pack can include:

Config.Packs = {
    ['basic'] = {
        label = 'Civilian Starter Pack',
        description = 'A simple start for an honest worker.',
        icon = 'briefcase',
        rewards = {
            money = {
                enabled = true,
                cash = 5000,
                bank = 10000
            },
            items = {
                enabled = true,
                list = {
                    {name = 'phone', count = 1},
                    {name = 'water', count = 5},
                    {name = 'bread', count = 5}
                }
            },
            weapons = {
                enabled = false,
                list = {
                    {name = 'WEAPON_BAT', ammo = 1}
                }
            },
            vehicle = {
                enabled = true,
                model = 'blista',
                spawnPoint = vector4(-1032.6547, -2728.7517, 19.6406, 56.3793)
            }
        }
    }
}

๐Ÿ“ File Structure

StarterPack/
โ”œโ”€โ”€ README.md                 # This file
โ”œโ”€โ”€ fxmanifest.lua           # FiveM manifest
โ”œโ”€โ”€ config.lua               # Configuration file
โ”œโ”€โ”€ starterpacks.sql         # Database schema
โ”œโ”€โ”€ client/
โ”‚   โ””โ”€โ”€ main.lua             # Client-side code
โ”œโ”€โ”€ server/
โ”‚   โ””โ”€โ”€ main.lua             # Server-side code
โ””โ”€โ”€ public/
    โ””โ”€โ”€ lib.js               # Utility library

๐ŸŽฎ Usage

For Players

  1. Locate the Starter Pack NPC at the airport on your map (blip appears)
  2. Approach the NPC
  3. If using ox_target: Click the interaction option
  4. If using DrawText3D: Press 'E' when prompted
  5. Select your desired starter pack from the menu
  6. Receive your rewards instantly

For Administrators

Add a New Starter Pack

Edit config.lua and add a new pack under Config.Packs:

['engineer'] = {
    label = 'Engineer Starter Pack',
    description = 'For mechanics and engineers.',
    icon = 'wrench',
    rewards = {
        money = { enabled = true, cash = 3000, bank = 7000 },
        items = { enabled = true, list = {{name = 'toolbox', count = 1}} },
        weapons = { enabled = false, list = {} },
        vehicle = { enabled = true, model = 'dilettante', spawnPoint = vector4(...) }
    }
}

Reset Player Claims

Run this SQL query to allow a player to claim again:

DELETE FROM starterpacks WHERE identifier = 'PLAYER_IDENTIFIER';

View All Claims

SELECT * FROM starterpacks;

๐Ÿ”Œ API Reference

Client-Side Callbacks

starterpack:checkClaimStatus

Checks if the current player has already claimed a starter pack.

Returns: boolean - true if already claimed, false otherwise

local hasClaimed = lib.callback.await('starterpack:checkClaimStatus')

starterpack:claimPack

Attempts to claim a specific starter pack for the player.

Parameters:

  • packId (string): The ID of the pack to claim

Returns: boolean, string - Success status and message

local success, message = lib.callback.await('starterpack:claimPack', false, 'basic')

๐Ÿ› Troubleshooting

Issue Solution
NPC not appearing Check NPC coordinates in config.lua; ensure model exists
Can't interact with NPC Verify ox_target is running if UseTarget = true
Discord webhook not working Check webhook URL format and permissions
Database errors Ensure starterpacks table is created; check oxmysql is running
Players can claim multiple times Check starterpacks table for duplicate entries

๐Ÿ” Security Features

  • One-Claim Protection: Players can only claim once per identifier
  • Server-Side Validation: All claims processed on server-side
  • Database Tracking: Complete audit trail of who claimed what and when
  • Discord Logging: Optional webhook logging for admin oversight

๐Ÿ“Š Database Schema

starterpacks Table

Column Type Description
identifier varchar(60) Player's unique identifier (Primary Key)
claimed tinyint(1) Claim status (1 = claimed)
claimed_at timestamp When the pack was claimed

๐ŸŽจ Customization Examples

Example 1: Adding a Job-Specific Pack

['mechanic'] = {
    label = 'Mechanic Starter Pack',
    description = 'Tools and cash for mechanics.',
    icon = 'hammer',
    rewards = {
        money = { enabled = true, cash = 2000, bank = 3000 },
        items = { enabled = true, list = {{name = 'advancedtoolbox', count = 1}} },
        weapons = { enabled = false, list = {} },
        vehicle = { enabled = true, model = 'rumpo', spawnPoint = vector4(...) }
    }
}

Example 2: Disabling Discord Logging

Config.DiscordWebhook = "" -- Empty string disables logging

Example 3: Using DrawText3D Instead of ox_target

Config.UseTarget = false

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘จโ€๐Ÿ’ป Author

Aiben - Created and maintained with โค๏ธ


๐Ÿ™‹ Support

For issues, questions, or suggestions:


๐Ÿ“š Resources & Links


๐ŸŽฏ Roadmap

  • GUI improvements with more customization options
  • Skill points system based on starter pack
  • Time-limited special packs
  • Player statistics dashboard
  • Integration with job systems
  • Multilingual support

โญ Show Your Support

If you find this script useful, please consider giving it a star! It helps others discover this resource.


Enjoy your Starter Pack System! ๐ŸŽ‰

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages