Neler yeni

Foruma hoş geldin, Ziyaretçi

Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.

Türkiye'nin İlk ve tek FiveM forum adresi

Forum adresimize hoş geldin FiveMTürk olarak amacımız siz değerli kullanıcılarımıza en aktif fikir ve paylaşım platformu sunmak bir yana en güvenilir şekilde alışveriş yapabileceğiniz bir platform sunmaktır.
DF DF
DF DF
DF DF

Soru Qb-smallresources Sıkı Kemer Ayarlama

iEmirRekt

Üye
FT Kullanıcı
Katılım
6 ay 21 gün
Mesajlar
9
Web sitesi
luaroleplay.com.tr
Discord
emiromer44
Aşağıdaki koddaki qbnin kendi smallresources ın içinde bulunan kemer var ama kemeri takmama rahmen vurunca uçuyotum ister 1000km hızla vuruyim ister 1km hızla vuriyim kemer takılıysa fırlatmamasını istiyorum nasıl ayarlarım acaba ?

local QBCore = exports['qb-core']:GetCoreObject()
local seatbeltOn = false
local harnessOn = false
local harnessHp = Config.HarnessUses
local handbrake = 0
local sleep = 0
local harnessData = {}
local newVehBodyHealth = 0
local currVehBodyHealth = 0
local frameBodyChange = 0
local lastFrameVehSpeed = 0
local lastFrameVehSpeed2 = 0
local thisFrameVehSpeed = 0
local tick = 0
local damageDone = false
local modifierDensity = true
local lastVeh = nil
local veloc
-- Functions
local function ejectFromVehicle()
local ped = PlayerPedId()
local veh = GetVehiclePedIsIn(ped, false)
local coords = GetOffsetFromEntityInWorldCoords(veh, 1.0, 0.0, 1.0)
SetEntityCoords(ped, coords.x, coords.y, coords.z)
Wait(1)
SetPedToRagdoll(ped, 5511, 5511, 0, 0, 0, 0)
SetEntityVelocity(ped, veloc.x * 4, veloc.y * 4, veloc.z * 4)
local ejectSpeed = math.ceil(GetEntitySpeed(ped) * 8)
if GetEntityHealth(ped) - ejectSpeed > 0 then
SetEntityHealth(ped, GetEntityHealth(ped) - ejectSpeed)
elseif GetEntityHealth(ped) ~= 0 then
SetEntityHealth(ped, 0)
end
end
local function toggleSeatbelt()
seatbeltOn = not seatbeltOn
SeatBeltLoop()
TriggerEvent("seatbelt:client:ToggleSeatbelt")
TriggerServerEvent("InteractSound_SV:playWithinDistance", 5.0, seatbeltOn and "carbuckle" or "carunbuckle", 0.25)
end
local function toggleHarness()
harnessOn = not harnessOn
if not harnessOn then return end
toggleSeatbelt()
end
local function resetHandBrake()
if handbrake <= 0 then return end
handbrake -= 1
end
function SeatBeltLoop()
CreateThread(function()
while true do
sleep = 0
if seatbeltOn or harnessOn then
DisableControlAction(0, 75, true)
DisableControlAction(27, 75, true)
end
if not IsPedInAnyVehicle(PlayerPedId(), false) then
seatbeltOn = false
harnessOn = false
TriggerEvent("seatbelt:client:ToggleSeatbelt")
break
end
if not seatbeltOn and not harnessOn then break end
Wait(sleep)
end
end)
end
-- Export
---Checks whether you have the harness on or not
--- R Return boolean
local function hasHarness()
return harnessOn
end
exports("HasHarness", hasHarness)
-- Ejection Logic
RegisterNetEvent('QBCore:Client:EnteredVehicle', function()
local ped = PlayerPedId()
while IsPedInAnyVehicle(ped, false) do
Wait(0)
local currVehicle = GetVehiclePedIsIn(ped, false)
if currVehicle and currVehicle ~= false and currVehicle ~= 0 then
SetPedHelmet(ped, false)
lastVeh = GetVehiclePedIsIn(ped, false)
if GetVehicleEngineHealth(currVehicle) < 0.0 then
SetVehicleEngineHealth(currVehicle, 0.0)
end
if (GetVehicleHandbrake(currVehicle) or (GetVehicleSteeringAngle(currVehicle)) > 25.0 or (GetVehicleSteeringAngle(currVehicle)) < -25.0) then
if handbrake == 0 then
handbrake = 100
resetHandBrake()
else
handbrake = 100
end
end
thisFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6
currVehBodyHealth = GetVehicleBodyHealth(currVehicle)
if currVehBodyHealth == 1000 and frameBodyChange ~= 0 then
frameBodyChange = 0
end
if frameBodyChange ~= 0 then
if lastFrameVehSpeed > 110 and thisFrameVehSpeed < (lastFrameVehSpeed * 0.75) and not damageDone then
if frameBodyChange > 18.0 then
if not seatbeltOn and not IsThisModelABike(currVehicle) then
if math.random(math.ceil(lastFrameVehSpeed)) > 60 then
if not harnessOn then
ejectFromVehicle()
else
harnessHp -= 1
TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData)
end
end
elseif (seatbeltOn or harnessOn) and not IsThisModelABike(currVehicle) then
if lastFrameVehSpeed > 150 then
if math.random(math.ceil(lastFrameVehSpeed)) > 150 then
if not harnessOn then
ejectFromVehicle()
else
harnessHp -= 1
TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData)
end
end
end
end
else
if not seatbeltOn and not IsThisModelABike(currVehicle) then
if math.random(math.ceil(lastFrameVehSpeed)) > 60 then
if not harnessOn then
ejectFromVehicle()
else
harnessHp -= 1
TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData)
end
end
elseif (seatbeltOn or harnessOn) and not IsThisModelABike(currVehicle) then
if lastFrameVehSpeed > 120 then
if math.random(math.ceil(lastFrameVehSpeed)) > 200 then
if not harnessOn then
ejectFromVehicle()
else
harnessHp -= 1
TriggerServerEvent('seatbelt:DoHarnessDamage', harnessHp, harnessData)
end
end
end
end
end
damageDone = true
SetVehicleEngineOn(currVehicle, false, true, true)
end
if currVehBodyHealth < 350.0 and not damageDone then
damageDone = true
SetVehicleEngineOn(currVehicle, false, true, true)
Wait(1000)
end
end
if lastFrameVehSpeed < 100 then
Wait(100)
tick = 0
end
frameBodyChange = newVehBodyHealth - currVehBodyHealth
if tick > 0 then
tick -= 1
if tick == 1 then
lastFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6
end
else
if damageDone then
damageDone = false
frameBodyChange = 0
lastFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6
end
lastFrameVehSpeed2 = GetEntitySpeed(currVehicle) * 3.6
if lastFrameVehSpeed2 > lastFrameVehSpeed then
lastFrameVehSpeed = GetEntitySpeed(currVehicle) * 3.6
end
if lastFrameVehSpeed2 < lastFrameVehSpeed then
tick = 25
end
end
if tick < 0 then
tick = 0
end
newVehBodyHealth = GetVehicleBodyHealth(currVehicle)
if not modifierDensity then
modifierDensity = true
end
veloc = GetEntityVelocity(currVehicle)
else
if lastVeh then
SetPedHelmet(ped, true)
Wait(200)
newVehBodyHealth = GetVehicleBodyHealth(lastVeh)
if not damageDone and newVehBodyHealth < currVehBodyHealth then
damageDone = true
SetVehicleEngineOn(lastVeh, false, true, true)
Wait(1000)
end
lastVeh = nil
end
lastFrameVehSpeed2 = 0
lastFrameVehSpeed = 0
newVehBodyHealth = 0
currVehBodyHealth = 0
frameBodyChange = 0
Wait(2000)
break
end
end
end)
-- Events
RegisterNetEvent('seatbelt:client:UseHarness', function(ItemData) -- On Item Use (registered server side)
local ped = PlayerPedId()
local inVeh = IsPedInAnyVehicle(ped, false)
local class = GetVehicleClass(GetVehiclePedIsUsing(ped))
if inVeh and class ~= 8 and class ~= 13 and class ~= 14 then
if not harnessOn then
LocalPlayer.state:set("inv_busy", true, true)
QBCore.Functions.Progressbar("harness_equip", Lang:t('seatbelt.use_harness_progress'), 5000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function()
LocalPlayer.state:set("inv_busy", false, true)
toggleHarness()
TriggerServerEvent('equip:harness', ItemData)
end)
harnessHp = ItemData.info.uses
harnessData = ItemData
TriggerEvent('hud:client:UpdateHarness', harnessHp)
else
LocalPlayer.state:set("inv_busy", true, true)
QBCore.Functions.Progressbar("harness_equip", Lang:t('seatbelt.remove_harness_progress'), 5000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function()
LocalPlayer.state:set("inv_busy", false, true)
toggleHarness()
end)
end
else
QBCore.Functions.Notify(Lang:t('seatbelt.no_car'), 'error')
end
end)
-- Register Key
RegisterCommand('toggleseatbelt', function()
if not IsPedInAnyVehicle(PlayerPedId(), false) or IsPauseMenuActive() then return end
local class = GetVehicleClass(GetVehiclePedIsUsing(PlayerPedId()))
if class == 8 or class == 13 or class == 14 then return end
toggleSeatbelt()
end, false)
RegisterKeyMapping('toggleseatbelt', 'Toggle Seatbelt', 'keyboard', 'K')
 
Kullandığın hud, tgiann'ın x bir hud'u ise, configini kurcala.
 

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Kayıt ol

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Şimdi kayıt ol
Giriş yap

Eğer bir hesabınız var ise lütfen giriş yapın

Giriş yap

Bu konuyu görüntüleyen kullanıcılar

Tema düzenleyici

Tema özelletirmeleri

Granit arka planlar

Lütfen Javascript'i etkinleştirin!Javascript'i etkinleştirin!