Configuration

A fully documented config.lua for the MD Tires script.

--======================================================================
--  MD Tires - Config
--======================================================================
--  Standalone resource. No framework dependencies.
--  Edit values below to tune gameplay and UI.
--
--  Notes:
--   - All key codes are FiveM control IDs (INPUT_*). Example: 47 = G.
--   - Allowed weapons are defined as strings and hashed once client-side.
--   - Server-side validation uses only server-safe natives (entity + distance).
--======================================================================

Config = {}

--======================================================================
--  Controls / Interaction
--======================================================================

-- Key to start slashing (default: G)
Config.Key = 47 -- INPUT_DETONATE (G)

-- Key to cancel while slashing (default: X)
Config.CancelKey = 73 -- INPUT_VEH_DUCK (X)

-- Only allow the action if player is on foot
Config.RequireOnFoot = true

-- Require a melee weapon in hand (purely client-side gating; no inventory dependency)
Config.RequireMeleeWeapon = true

-- Allowed weapons (strings only - hashed internally with joaat())
Config.AllowedWeaponModels = {
  "WEAPON_KNIFE",
  "WEAPON_DAGGER",
  "WEAPON_SWITCHBLADE",
  "WEAPON_MACHETE",
  "WEAPON_BOTTLE",
}

--======================================================================
--  Distances / Timings
--======================================================================

-- Max distance from player to wheel to show prompt / allow interaction
Config.MaxWheelDistance = 1.25

-- Time to complete slashing action (milliseconds)
Config.SlashDurationMs = 9500

-- Cooldown after an attempt (milliseconds) to prevent spam
Config.ActionCooldownMs = 1500

--======================================================================
--  UI
--======================================================================

-- 3D prompt text shown at closest wheel
Config.PromptText = "[G] Slash tire"

-- Cancel hint (shown during progress)
Config.CancelText = "Press [X] to cancel"

-- 3D prompt Z offset above wheel bone (meters)
Config.PromptZOffset = 0.35

--======================================================================
--  Animation / Feedback
--======================================================================

-- Animation used when UseScenario = false
Config.AnimDict = "amb@world_human_gardener_plant@male@base"
Config.AnimName = "base"
Config.AnimFlag = 49

-- Play a small frontend sound when successfully popping
Config.PlaySound = true

-- Block emergency-class vehicles (police/ambulance/fire)
Config.BlockEmergencyVehicles = false

--======================================================================
--  Server-Side Validation (anti-abuse)
--======================================================================
--  The server validates the event request using distance checks.
--  Because wheel/bone natives are client-only, the server relies on:
--   - netId -> entity existence
--   - entity type must be vehicle
--   - player near vehicle
--   - (optional) player near client-reported wheel position
--   - wheel index within sane range (0..7)
--
--  These values tune strictness. Tighter values = more secure, but can
--  be less forgiving with desync/lag.
--======================================================================

-- Extra distance allowed above MaxWheelDistance when validating wheelPos
Config.ServerDistancePadding = 0.75

-- Maximum distance a reported wheelPos can be from vehicle coords (sanity check)
Config.ServerWheelPosMaxFromVehicle = 5.0

-- Maximum distance a player can be from vehicle coords (sanity check)
Config.ServerPlayerMaxFromVehicle = 4.0

Last updated