RedM
  • 🇫🇷Home
  • 🧑‍🌾Ambient NPC
  • ⛺Campement
  • 🃏Card Collection
  • ♟️Chess & Checkers Game
  • 💣Dynamite
  • 🙋Environment animations
  • 🔥Fire sync
  • 🐎Feeding Horse + Syringe
  • 🚭Illicit Sales
  • ⚖️Instances
  • 📥Market Stall
  • 🩺Medical Records
  • 🍲Metabolism
  • 🗣️Mumble Block UI
  • ⏸️Pause Menu
  • ⌨️Quick Keys Menu
  • 💵Reward Loyalty and Total playtime
  • 🖋️Tattoo
  • 🥇Top Serveurs
  • ⚰️Undertaker
  • 💀Wanted
  • 🔫Weapon Cleaning Animation
  • 🏹Weapon Rack
Powered by GitBook
On this page

Dynamite

Script developed for the server LGW⚡WL+18 FR-QC⚡SERIOUS RP✨FPS OPTIMIZED✨UNIQUE MAPPING-SCRIPT

This scripts allows players to place dynamite and then detonate it with a detonator connected by a wire.

The dynamite spreads a fire that remains active until players extinguished the fire or the server is rebooted.


Vorp Core must use item in Config.ItemName

Others Framework must use Client Event :

Client Side

TriggerEvent("BTFire:placeFire")

Server Side

TriggerClientEvent("BTFire:placeFire", source)

You can use client-side event `BTFire:placeDynamiteAtCoords(vector3)` to manually trigger a fire at given coordinates.

-- From client side
TriggerEvent("BTFire:placeDynamiteAtCoords", vector3(3288.76, -1282.01, 50.76))
-- From server side
TriggerClientEvent("BTFire:placeDynamiteAtCoords", source, vector3(3288.76, -1282.01, 50.76))

Here is an excerpt from the config.lua file : (parts of the excerpt are hidden) :

Config = {}
Config.DEBUG            = false  -- Enables debug mode to use dynamite when start/restart
--- Activate the Script
Config.ItemName         = "kit_dynamite"  -- VORP Only : Sets the item name required to start the script.
-- OTHERS FRAMEWORKS: TriggerClientEvent("BTFire:placeFire", source) or TriggerEvent("BTFire:placeFire")
--- Prompt
Config.PromptGroupLabel = "Dynamite"  -- Sets the label for the dynamite/detonator group.
Config.PromptDynamite   = "Place the dynamite"  -- Text for the prompt to place dynamite.
Config.PromptDetonator  = "Place the detonator"  -- Text for the prompt to place the detonator.
Config.PromptCancel     = "Put away the dynamite"  -- Text for the prompt to cancel and put away the dynamite or the detonator.
Config.IgniteKey        = keys["E"]  -- Sets the key to place the dynamite and place the detonator.
Config.CancelKey        = keys["R"]  -- Sets the key to cancel the action and put away the bucket, the dynamite or the detonator.
Config.PromptGroupWater = "Extinguish the fire"  -- Sets the label for the water/bucket group.
Config.PromptBucket     = "Take a bucket"  -- Text for the prompt to take a bucket.
Config.PromptWater      = "Fill bucket with water"  -- Text for the prompt to collect water.
Config.PromptWaterUse   = "Throw water on the fire"  -- Text for the prompt to use the water on the fire.
Config.PromptWBCancel   = "Put down the water bucket"  -- Text for the prompt to cancel and put away the bucket.
Config.BucketWaterKey   = keys["E"]  -- Sets the key to get a bucket, fill it with water and use water on the fire.
--- Inside/Outside building
Config.AllowOutside     = true -- Allow the dynamite outside building
Config.FireMinOutside   = 3    -- Sets the minimum number of fire circles outside.
Config.FireMaxOutside   = 5    -- Sets the maximum number of fire circles outside.
Config.FireMinInside    = 5    -- Sets the minimum number of fire circles inside building.
Config.FireMaxInside    = 10   -- Sets the maximum number of fire circles inside building.
--- Fire & Smoke
Config.EnableFireSmoke  = true  -- Adds a large flame with smoke visible from afar, as well as ambient smoke fog in the surrounding area of the fire.
--- Fire Extinguish
Config.AllowExtinguish  = true -- Allows players to extinguish fire.
Config.BucketRadius     = 4.0   -- The distance from the fire at which the player can collect a bucket.
--- Dynamite parameters
Config.WireLength       = 15.0 -- The length of the detonator wire. Can't be under 10.0. (Be careful, a long wire can cause player crash due to game physics)
Config.ExplodeTime      = 10  -- Sets the time in seconds before the dynamite explodes. (for example : you can use math.random(5,15) to get a random countdown between 5 and 15 seconds)
Config.ShowCountDown    = true -- Show (true) or Hide (false) the time before the explosion.
Config.CountDownStyle   = 2 -- 1 - use javascript Countdown / 2 - use RDR2 multiplayer Countdown
--- Discord
Config.DiscordWebhook   = "" -- Discord canal webhook (ex : https://discord.com/api/webhooks/1212121212/StmZ_AazZZykg69RY1gRZnp7h4121212AZAbAbBlWxyJzaMq)
Config.DiscordName      = "BT_DYNAMITE" -- The title of the Discord message.

Config.Txt = {
    TooFar = "Warning, you are going too far, the wire might break.",  -- Warning message when moving too far.
    TooFarGone = "The wire has broken"  -- Message when the string breaks.
}

function TriggerFireExplosion(coords)
    print("Explosion location : ".. coords.x .. " " .. coords.y .." " .. coords.z)
end

-- Sends a server-side notification to the player.
function SendServerNotification(source, message)
    TriggerClientEvent("vorp:TipRight", source, message, 5000) -- Sends a notification using the VORP framework.
    TriggerClientEvent("redem_roleplay:NotifyRight", source, message, 3000) -- Sends a notification using the REDEM framework.
    TriggerClientEvent('RSGCore:Notify', source, message, "error") -- Sends a notification using the RSG framework.
end

-- Sends a client-side notification to the player.
function SendClientNotification(message)
    TriggerEvent("vorp:TipRight", message, 5000) -- Sends a notification using the VORP framework.
    TriggerEvent("redem_roleplay:NotifyRight", message, 3000) -- Sends a notification using the REDEM framework.
    TriggerEvent('RSGCore:Notify', message, "error", 3000) -- Sends a notification using the RSG framework.
end

-- this content is hidden in the excerpt

Last updated 11 days ago

💣