[ESX] [FREE] Deathtimeout

If you get revived by a medic you cannot use your weapon x secods

marlox_Deathtimeout.zip (1.6 KB)

Tebex

Code is accessible Yes
Subscription-based No
Lines (approximately) 40
Requirements ESX
Support Yes
6 Likes

You know what would just be the best thing. If you ever told us what this script does! Isn’t that crazy…

nice job, looks good

Oh sorry xD

If you get revived by a medic you cannot use your weapon x secods

Git is 404

is it any weapon? The code looks like its only pistol.

That’s really cool, I’ve been looking for something like this for a long time.
Thx

not at the moment, but with some edits its easy
Just replace them with this
client.lua

local indead = false
CreateThread(function()
    while ESX == nil do
        TriggerEvent(Config.esxgetSharedObjectevent, function(obj) ESX = obj end)
        Wait(0)
    end      
    
    RegisterNetEvent(Config.revive)
    AddEventHandler(Config.revive, function()
        indead = true
        Settimer()
    end)

    function Settimer()
        local time = Config.time
        CreateThread(function()
            while indead do
                Wait(0)
                while time > 0 and indead do
                    Wait(1000)
                    if time > 0 then
                        time = time - 1
                    elseif time <= 1 then
                        indead = false
                        break
    
                    end
                end
            end
        end)      
        CreateThread(function()
            while indead do
                Wait(1)
                if time > 0 then
                    for _,v in next, Config.weaponsDead do
						local ped = PlayerPedId()
						DisablePlayerFiring(ped, true)
						SetCanPedEquipWeapon(ped, GetHashKey(v), false)
						drawTxt(0.87, 0.50, 1.0,1.0,0.4, "Du bist noch für ~g~"..time.." Sekunden~s~ Kampfunfähig.")
					end
                elseif time <= 1 then
                    for _,v in next, Config.weaponsDead do
						local ped = PlayerPedId()
						DisablePlayerFiring(ped, true)
						SetCanPedEquipWeapon(ped, GetHashKey(v), true)
						indead = false
					end
                end
            end
        end)   
    end    
    
    function drawTxt(x, y, width, height, scale, text)
        SetTextFont(0)
        SetTextProportional(0)
        SetTextScale(scale, scale)
        SetTextColour(255, 255, 255, 255)
        SetTextDropShadow(0, 0, 0, 0,255)
        SetTextEdge(1, 0, 0, 0, 255)
        SetTextDropShadow()
        SetTextOutline()
        SetTextEntry('STRING')
        AddTextComponentString(text)
        DrawText(x - width/2, y - height/2 + 0.005)

    end

end)

Config.lua

Config = {
    esxgetSharedObjectevent = 'esx:getSharedObject',
    --revive = 'esx_ambulancejob:revive',
    revive = 'fijksdhfiudsjhfishfkjlshfkjdshfkjshkfjsdhfjsdfadmin',
    time = 120 -- Secunds
}

Config.weaponsDead = {
	"WEAPON_MICROSMG",
	"WEAPON_SMG",
	"WEAPON_SMG_MK2",
	"WEAPON_ASSAULTSMG",
	"WEAPON_COMBATPDW",
	"WEAPON_MACHINEPISTOL",
	"WEAPON_MINISMG",
	"WEAPON_RAYCARBINE",
	"WEAPON_PUMPSHOTGUN",
	"WEAPON_PUMPSHOTGUN_MK2",
	"WEAPON_SAWNOFFSHOTGUN",
	"WEAPON_ASSAULTSHOTGUN",
	"WEAPON_BULLPUPSHOTGUN",
	"WEAPON_MUSKET",
	"WEAPON_HEAVYSHOTGUN",
	"WEAPON_DBSHOTGUN",
	"WEAPON_AUTOSHOTGUN",
	"WEAPON_COMBATSHOTGUN",
	"WEAPON_ASSAULTRIFLE",
	"WEAPON_ASSAULTRIFLE_MK2",
	"WEAPON_CARBINERIFLE",
	"WEAPON_CARBINERIFLE_MK2",
	"WEAPON_ADVANCEDRIFLE",
	"WEAPON_SPECIALCARBINE",
	"WEAPON_SPECIALCARBINE_MK2",
	"WEAPON_BULLPUPRIFLE",
	"WEAPON_BULLPUPRIFLE_MK2",
	"WEAPON_COMPACTRIFLE",
	"WEAPON_MILITARYRIFLE",
	"WEAPON_HEAVYRIFLE",
	"WEAPON_MG",
	"WEAPON_COMBATMG",
	"WEAPON_COMBATMG_MK2",
	"WEAPON_GUSENBERG",
	"WEAPON_SNIPERRIFLE",
	"WEAPON_HEAVYSNIPER",
	"WEAPON_HEAVYSNIPER_MK2",
	"WEAPON_MARKSMANRIFLE",
	"WEAPON_MARKSMANRIFLE_MK2",
	"WEAPON_RPG",
	"WEAPON_GRENADELAUNCHER",
	"WEAPON_GRENADELAUNCHER_SMOKE",
	"WEAPON_MINIGUN",
	"WEAPON_FIREWORK",
	"WEAPON_RAILGUN",
	"WEAPON_HOMINGLAUNCHER",
	"WEAPON_COMPACTLAUNCHER",
	"WEAPON_RAYMINIGUN",
	"WEAPON_EMPLAUNCHER",
},
2 Likes

love it

Can you do pls qb?