ev_grandma

EV Grandma Revive System

The EV Grandma Revive System allows players to get revived at specific NPCs, such as "Grandma" or "Grandpa," without needing hospital services. This is designed primarily for criminal-based gameplay or servers where hospital reliance isn't ideal.


Features

  • Multiple NPC locations for revival.

  • Fully integrated with ox_lib for advanced functionality.

  • Costs and payment methods configurable.

  • Player animations and NPC interactions.

  • Prevents abuse with "busy" checks and player validations.


Configuration

Server Configuration

The following settings can be modified to customize the revival system:

Client Configuration

NPC spawn, animations, and interaction points are managed through the client-side script.


Usage Instructions

How It Works

  1. NPC Locations:

    • Defined in Server.locations.

    • Each NPC has unique coordinates, a model, and a "busy" status.

  2. Interaction:

    • Players approach an NPC within the defined radius.

    • Use the ox_target or qb-target interaction to trigger the revive process.

  3. Revival Process:

    • The player is charged (if applicable) and begins the revival process.

    • Animations are synced for both the player and NPC.

    • After the defined duration, the player is revived.


Integration

Framework Support

  • Fully supports QBCore and ESX.

  • Payment methods adapt automatically based on the selected framework:

    • QBCore: Handles cash or bank.

    • ESX: Automatically converts cash to money.


Key Functions

Client-Side

  1. Spawn NPCs:

    • Spawns the NPCs dynamically when a player is within range.

  2. Revive Interaction:

    • Triggers the revive process using ox_target or qb-target.

  3. Progress Circle:

    • Visual feedback for the revival process.


Server-Side

  1. Revive Logic:

    • Handles player validations, payments, and animations.

  2. Sync Animations:

    • Ensures all nearby players see the revival animations.


Example Scenarios

Scenario 1: Standard Revival

  1. A player approaches Grandma at a defined location.

  2. The player interacts using ox_target or qb-target.

  3. The server validates payment and availability.

  4. The player begins the revival process and is revived after the progress bar completes.


Scenario 2: Busy NPC

  1. Two players approach the same NPC.

  2. The first player begins the revive process.

  3. The second player receives a notification: "Grandma is busy right now."


Notes

  1. NPC Removal:

    • NPCs are despawned when players leave the interaction radius.

    • Proper cleanup ensures server performance.

  2. Custom Costs:

    • Adjust Server.cost to set the revival price. Set to 0 for free revives.

  3. Multiple NPCs:

    • Add as many NPCs as needed by modifying Server.locations.


Last updated