Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wm 1 #449

Closed
wants to merge 3 commits into from
Closed

Wm 1 #449

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/consumables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
66 changes: 66 additions & 0 deletions client/ignore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading