From 069f18a2e5111b89d3024bc06fed1213c3847b40 Mon Sep 17 00:00:00 2001 From: Walter-Mazzanti <70164732+Joris-abrate@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:54:44 +0100 Subject: [PATCH 1/2] Update consumables.lua --- client/consumables.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/consumables.lua b/client/consumables.lua index 13a185ea..034dc48f 100644 --- a/client/consumables.lua +++ b/client/consumables.lua @@ -517,7 +517,7 @@ function AlcoholLoop() while true do Wait(10) if alcoholCount > 0 then - Wait(1000 * 60 * 15) + Wait(1000 * 60 * 15) -- Vitto 15 minutes refresh time for alcohol alcoholCount -= 1 else looped = false From 993115cd8e5ac9e5d4cc6677b3c4cb48e53f0e8f Mon Sep 17 00:00:00 2001 From: Walter-Mazzanti <70164732+Joris-abrate@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:04:41 +0100 Subject: [PATCH 2/2] Update ignore.lua --- client/ignore.lua | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/client/ignore.lua b/client/ignore.lua index be29a271..de44bdfb 100644 --- a/client/ignore.lua +++ b/client/ignore.lua @@ -107,6 +107,72 @@ RegisterNetEvent('QBCore:Client:DrawWeapon', function() end end) +----------------------- +-- Vitto Taser ammo +maxTaserCarts = 3 -- The amount of taser cartridges a person can have. + +local QBCore = exports['qb-core']:GetCoreObject() +local taserCartsLeft = maxTaserCarts + +RegisterNetEvent("FillTaser") +AddEventHandler("FillTaser",function(source, args, rawCommand) + + QBCore.Functions.Progressbar("load_tazer", "Rechargement du Taser..", 2000, false, true, { + disableMovement = false, + disableCarMovement = false, + disableMouse = false, + disableCombat = true, + }, { + animDict = "anim@weapons@pistol@singleshot_str", + anim = "reload_aim", + flags = 48, + }, {}, {}, function() -- Done + + taserCartsLeft = maxTaserCarts + TriggerServerEvent("QBCore:Server:RemoveItem", "taserammo", 1) + TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items["taserammo"], "remove") + end) +end) + +local taserModel = GetHashKey("WEAPON_STUNGUN") + +CreateThread(function() +while true do + Wait(0) + local ped = PlayerPedId() + if GetSelectedPedWeapon(ped) == taserModel then + if IsPedShooting(ped) then + DisplayAmmoThisFrame(true) + taserCartsLeft = taserCartsLeft - 1 + end + end + + if taserCartsLeft <= 0 then + if GetSelectedPedWeapon(ped) == taserModel then + SetPlayerCanDoDriveBy(ped, false) + DisablePlayerFiring(ped, true) + if IsControlJustReleased(0, 106) then + QBCore.Functions.Notify("Vous devez recharger votre taser!", "error") + end + end + end + + if longerTazeTime then + SetPedMinGroundTimeForStungun(ped, longerTazeSecTime * 1000) + end +end +end) +----------------------- + +-- Vitto +CreateThread(function() -- Train/metro spawn + SwitchTrainTrack(0, true) + SwitchTrainTrack(3, true) + N_0x21973bbf8d17edfa (0, 120000) + SetRandomTrains(true) +end) +----------------------- + CreateThread(function() local pedPool = GetGamePool('CPed') for _, v in pairs(pedPool) do