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

Yardım MF_stress Yardım

KrewellaTR

Üye
FT Kullanıcı
Katılım
4 yıl 9 ay 8 gün
Mesajlar
163
Arkadaşlar bugün nopixel hudunu kendi serverime entegre ettim fakat yemek su azalmıyor stress şu şekilde gözüküyor sigara kullanınca (cigarette) azalmıyor /heal yazıyorum 0 a düşmüyor nasıl entegre edeceğim ? 12971
 
esx_basicneeds scripti serverinize ekli mi?
 
esx_basicneeds ve esx_status güncel olmalı
 
SIRALAMA ;

start esx_basicneeds
start st-hud
start MF_Stress
start esx_status
 
Çok teşekkür ediyorum çalışıyor fakat stres artınca kafa dönme olayı olmuyor yine aynı şekilde stres çok az artıyor nasıl yaptığım ise

esx_basicneeds/client/main.lua 12-28 satırını şunun ile değiştirdim.

Kod:
AddEventHandler('esx_basicneeds:resetStatus', function()
    TriggerEvent('esx_status:set', 'hunger', 500000)
    TriggerEvent('esx_status:set', 'thirst', 500000)
    TriggerEvent('esx_status:set', 'stress', 100000)
end)

RegisterNetEvent('esx_basicneeds:healPlayer')
AddEventHandler('esx_basicneeds:healPlayer', function()
    -- restore hunger & thirst
    TriggerEvent('esx_status:set', 'hunger', 1000000)
    TriggerEvent('esx_status:set', 'thirst', 1000000)
    TriggerEvent('esx_status:set', 'stress', 200000)

    -- restore hp
    local playerPed = PlayerPedId()
    SetEntityHealth(playerPed, GetEntityMaxHealth(playerPed))
end)


esx_basicneeds/client/main.lua 42-114 satırını şunun ile değiştirdim.

Kod:
AddEventHandler('esx_status:loaded', function(status)

    TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
        return true
    end, function(status)
        status.remove(100)
    end)

    TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
        return true
    end, function(status)
        status.remove(75)
    end)

    TriggerEvent('esx_status:registerStatus', 'stress', 100000, '#cadfff', function(status)
        return false
    end, function(status)
        status.add(20)
    end)
    
    Citizen.CreateThread(function()
        while true do
            Citizen.Wait(1000)

            local playerPed  = PlayerPedId()
            local prevHealth = GetEntityHealth(playerPed)
            local health     = prevHealth
            local stressVal  = 0

            TriggerEvent('esx_status:getStatus', 'hunger', function(status)
                if status.val == 0 then
                    if prevHealth <= 150 then
                        health = health - 5
                    else
                        health = health - 1
                    end
                end
            end)

            TriggerEvent('esx_status:getStatus', 'thirst', function(status)
                if status.val == 0 then
                    if prevHealth <= 150 then
                        health = health - 5
                    else
                        health = health - 1
                    end
                end
            end)

            TriggerEvent('esx_status:getStatus', 'stress', function(status)
                stressVal = status.val
            end)

            if health ~= prevHealth then
                SetEntityHealth(playerPed, health)
            end

            if stressVal >= 750000 then
                Citizen.Wait(3000)
                ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.16)
            elseif stressVal >= 700000 then
                Citizen.Wait(4000)
                ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.12)
            elseif stressVal >= 600000 then
                Citizen.Wait(5000)
                ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.07)
            elseif stressVal >= 350000 then
                Citizen.Wait(6000)
                ShakeGameplayCam('LARGE_EXPLOSION_SHAKE', 0.03)
            end
        end
    end)
end)
 
Canım azalınca stress artmıyor onu da nerden ayarlıyacağım size zahmet.
 
esx_basicneeds/client/main.lua


Kod:
ESX          = nil
local IsDead = false
local IsAnimated = false

Citizen.CreateThread(function()
    while ESX == nil do
        TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
        Citizen.Wait(0)
    end
end)



AddEventHandler('esx_basicneeds:resetStatus', function()
    TriggerEvent('esx_status:set', 'hunger', 500000)
    TriggerEvent('esx_status:set', 'thirst', 500000)
end)

RegisterNetEvent('esx_basicneeds:healPlayer')
AddEventHandler('esx_basicneeds:healPlayer', function()
    -- restore hunger & thirst
    TriggerEvent('esx_status:set', 'hunger', 1000000)
    TriggerEvent('esx_status:set', 'thirst', 1000000)
    

    -- restore hp
    local playerPed = PlayerPedId()
    SetEntityHealth(playerPed, GetEntityMaxHealth(playerPed))
end)

AddEventHandler('esx:onPlayerDeath', function()
    IsDead = true
end)

AddEventHandler('playerSpawned', function(spawn)
    if IsDead then
        TriggerEvent('esx_basicneeds:resetStatus')
    end

    IsDead = false
end)

AddEventHandler('esx_status:loaded', function(status)

    TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#FFFF00',
        function(status)
            return false
        end, function(status)
            status.remove(100)
        end)

    TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0099FF',
        function(status)
            return false
        end, function(status)
            status.remove(75)
        end)

    Citizen.CreateThread(function()
        while true do
            Citizen.Wait(1000)

            local playerPed  = PlayerPedId()
            local prevHealth = GetEntityHealth(playerPed)
            local health     = prevHealth
            local stressVal  = 0

            TriggerEvent('esx_status:getStatus', 'hunger', function(status)
                if status.val == 0 then
                    if prevHealth <= 150 then
                        health = health - 5
                    else
                        health = health - 1
                    end
                end
            end)

            TriggerEvent('esx_status:getStatus', 'thirst', function(status)
                if status.val == 0 then
                    if prevHealth <= 150 then
                        health = health - 5
                    else
                        health = health - 1
                    end
                end
            end)

            if health ~= prevHealth then
                SetEntityHealth(playerPed, health)
            end
        end
    end)
end)

AddEventHandler('esx_basicneeds:isEating', function(cb)
    cb(IsAnimated)
end)

RegisterNetEvent('esx_basicneeds:onEat')
AddEventHandler('esx_basicneeds:onEat', function(prop_name)
    if not IsAnimated then
        prop_name = prop_name or 'prop_cs_burger_01'
        IsAnimated = true

        Citizen.CreateThread(function()
            local playerPed = PlayerPedId()
            local x,y,z = table.unpack(GetEntityCoords(playerPed))
            local prop = CreateObject(GetHashKey(prop_name), x, y, z + 0.2, true, true, true)
            local boneIndex = GetPedBoneIndex(playerPed, 18905)
            AttachEntityToEntity(prop, playerPed, boneIndex, 0.12, 0.028, 0.001, 10.0, 175.0, 0.0, true, true, false, true, 1, true)

            ESX.Streaming.RequestAnimDict('mp_player_inteat@burger', function()
                TaskPlayAnim(playerPed, 'mp_player_inteat@burger', 'mp_player_int_eat_burger_fp', 8.0, -8, -1, 49, 0, 0, 0, 0)

                Citizen.Wait(3000)
                IsAnimated = false
                ClearPedSecondaryTask(playerPed)
                DeleteObject(prop)
            end)
        end)

    end
end)

RegisterNetEvent('esx_basicneeds:onDrink')
AddEventHandler('esx_basicneeds:onDrink', function(prop_name)
    if not IsAnimated then
        prop_name = prop_name or 'prop_ld_flow_bottle'
        IsAnimated = true

        Citizen.CreateThread(function()
            local playerPed = PlayerPedId()
            local x,y,z = table.unpack(GetEntityCoords(playerPed))
            local prop = CreateObject(GetHashKey(prop_name), x, y, z + 0.2, true, true, true)
            local boneIndex = GetPedBoneIndex(playerPed, 18905)
            AttachEntityToEntity(prop, playerPed, boneIndex, 0.12, 0.028, 0.001, 10.0, 175.0, 0.0, true, true, false, true, 1, true)

            ESX.Streaming.RequestAnimDict('mp_player_intdrink', function()
                TaskPlayAnim(playerPed, 'mp_player_intdrink', 'loop_bottle', 1.0, -1.0, 2000, 0, 1, true, true, true)

                Citizen.Wait(3000)
                IsAnimated = false
                ClearPedSecondaryTask(playerPed)
                DeleteObject(prop)
            end)
        end)

    end
end)
 

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!