MFPD Store

MFPD-DragCorpse - EARLY ACCESS

MFPD-DragCorpse - EARLY ACCESS

$19.99

Add to Basket

EARLY ACCESS – This release will receive constant updates if needed to ensure you use it to the best! One-Time Purchase - Video Preview.

What MFPD-DragCorpse Does

  • Drag any downed entity – Players can /dragplayer to haul another (downed) player, or /drag to pick up an NPC — alive or dead — and move them around with smooth start/loop/end animations.
  • Seamless network sync – All attach/detach actions are routed through server events (syncPlayer/syncNPC → syncTarget/syncNPCTarget), so everyone sees the same dragging motion and final placement.
  • Auto-release & cleanup – Press the “duck” key (default X) to drop instantly; if either the dragger or dragged disconnects, the other is freed and animations are cleaned up automatically.

Framework & Job-Permission Support (new)

  • Config-drivenconfig.lua lets you pick "Standalone", "ESX" (legacy or new export) or "QB", and list jobs (e.g., "police", "ambulance") allowed to use the drag commands.
  • Silent checksHasDragPerm() runs each time; if the player’s job isn’t authorised, nothing happens—no chat spam.
  • Live job updates – ESX/QB job-change events update the cached job instantly, so permission is gained or lost without a relog.
  • Zero impact for Standalone – Set Framework = "Standalone" and all job logic is skipped.

Key Failsafes & Edge-Case Handling

  1. Distance & vehicle checks
    Rejects drag attempts beyond ≈5 m (players) or 4 m (NPCs) and blocks dragging anyone inside a vehicle.
  2. Entity protection
    Nearby vehicles/NPCs within 10 m are flagged as “mission entities” to prevent despawn; flags are cleared on release.
  3. AI-lock for NPCs
    Clears tasks, forces them out of vehicles, and freezes ambient AI so corpses don’t flail or wander off.
  4. Network-control timeouts
    When reviving a corpse (wasDead), requests control for up to 1 s before health-reset/kill operations.
  5. Disconnect safety
    Server keeps dragging, dragged, npcDragging tables; on playerDropped it fires “stop” events so no one stays stuck.

Why It’s More Complex:

  • Coroutine-based enumeration – Custom EnumerateEntities wraps native find/next APIs for cleaner loops.
  • Animation lifecycle management – Overrides TaskPlayAnim to auto-unload dictionaries after each play.
  • Dual code paths – Separate flows for “player → player” vs. “player → NPC” with distinct revive/kill logic.
  • Server-side enforcement – Range checks, integration hooks, and once-per-corpse guards ensure consistent behaviour.

Together, MFPD-DragCorpse is a robust, network-safe system for moving bodies (or live NPCs) around.

Back to category