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

Paylaşım Çöplerden Eşya Toplama

Drackles

Üye
FT Kullanıcı
Katılım
3 yıl 11 ay 22 gün
Mesajlar
40
Merhaba, İşinize Yarar mı Bilmem ama Kendi Yaptığım Çöplerden İtem Toplama Scriptini Paylaşmak istedim Farklı Farklı Çöplerden İtem Toplayabilirsiniz İsterseniz Aramak İstediğiniz Herhangi Başka Bir Objeyi Ekleyebilirsiniz itemlerin 1'le kaç arasında çıkacagını ayarlayabilirsiniz İyi Oyunlar.

Eşya Eklemek ve kaç oranla eşya çıkacağını ayarlamak için | esya_arama\config.lua

Eşya ve Paranın 1'le kaç arasında çıkacağını ayarlamak için | esya_arama\server\main.lua
(indiriyorsanız lütfen yorum yapmayı unutmayın) ;)




50559 50560 50561 50562 50563 50567

 
Son düzenleme:
Ve resmon degeri cok yuksek
 
Kodu bu şekilde kullanman ciddi anlamda optimizasyon artışı sağlıcaktır. Sleep çok basit bir method öğrenmeni tavsiye ederim.


C#:
ESX = nil

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

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
    PlayerData = xPlayer
end)

objects = {}

if Config.ObjectDropLoot then
    Citizen.CreateThread(function()
        while true do
            local sleep = 1250
            for k,v in pairs(Config.ObjectsLoot) do
                    local player = GetPlayerPed(-1)
                    local distanceobject = 2.2
                    local obj = GetClosestObjectOfType(GetEntityCoords(player).x, GetEntityCoords(player).y, GetEntityCoords(player).z, distanceobject, v, false, true ,true)
                    local distance = GetDistanceBetweenCoords(GetEntityCoords(player), GetEntityCoords(obj), true)
            
                if distance <= distanceobject then
                    sleep = 3

                    local ObjectCoords = GetEntityCoords(obj)

                    if not objects[obj] then
                    ESX.Game.Utils.DrawText3D(ObjectCoords + vector3(0.0, 0.0, 0.5), '~c~ARAMAK IÇIN ~b~[E]~c~ TUSUNA BAS', 1, 4)
                    end

                    if IsControlJustReleased(0, 38) then
                        if not objects[obj] then

                            SetCurrentPedWeapon(GetPlayerPed(-1), 0xA2719263, true)
                            RequestAnimDict("anim@amb@clubhouse@tutorial@bkr_tut_ig3@")
                            while not HasAnimDictLoaded("anim@amb@clubhouse@tutorial@bkr_tut_ig3@") do
                                Citizen.Wait(10)
                            end
                            TaskPlayAnim(PlayerPedId(), "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", "machinic_loop_mechandplayer", 2.0, 2.0, 4000, 30, 0, 0, 0, 0)
                            Citizen.Wait(4000)
                            randomChance = math.random(1, 100)
                            randomWeapon = Config.WeaponLootObject[math.random(1, #Config.WeaponLootObject)]
                            randomItem = Config.ItemLootObject[math.random(1, #Config.ItemLootObject)]

                            if randomChance > 0 and randomChance < Config.ProbabilityWeaponLootObject then
                                local randomAmmo = math.random(1, 30)
                                GiveWeaponToPed(GetPlayerPed(-1), randomWeapon, randomAmmo, true, false)
                                ESX.ShowNotification('Buldun ' .. randomWeapon)
                            elseif randomChance >= Config.ProbabilityWeaponLootObject and randomChance < Config.ProbabilityMoneyLootObject then
                                TriggerServerEvent('esya_arama:moneyloot')
                            elseif randomChance >= Config.ProbabilityMoneyLootObject and randomChance < Config.ProbabilityItemLootObject then
                                TriggerServerEvent('esya_arama:itemloot', randomItem)
                            elseif randomChance >= Config.ProbabilityItemLootObject and randomChance < 100 then
                                ESX.ShowNotification('Hiç Birsey Bulamadın')
                            end
                            objects[obj] = true
                           end
                    end
                end
            end
            Citizen.Wait(sleep)
        end
    end)
end
 
Kodu bu şekilde kullanman ciddi anlamda optimizasyon artışı sağlıcaktır. Sleep çok basit bir method öğrenmeni tavsiye ederim.


C#:
ESX = nil

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

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
    PlayerData = xPlayer
end)

objects = {}

if Config.ObjectDropLoot then
    Citizen.CreateThread(function()
        while true do
            local sleep = 1250
            for k,v in pairs(Config.ObjectsLoot) do
                    local player = GetPlayerPed(-1)
                    local distanceobject = 2.2
                    local obj = GetClosestObjectOfType(GetEntityCoords(player).x, GetEntityCoords(player).y, GetEntityCoords(player).z, distanceobject, v, false, true ,true)
                    local distance = GetDistanceBetweenCoords(GetEntityCoords(player), GetEntityCoords(obj), true)
           
                if distance <= distanceobject then
                    sleep = 3

                    local ObjectCoords = GetEntityCoords(obj)

                    if not objects[obj] then
                    ESX.Game.Utils.DrawText3D(ObjectCoords + vector3(0.0, 0.0, 0.5), '~c~ARAMAK IÇIN ~b~[E]~c~ TUSUNA BAS', 1, 4)
                    end

                    if IsControlJustReleased(0, 38) then
                        if not objects[obj] then

                            SetCurrentPedWeapon(GetPlayerPed(-1), 0xA2719263, true)
                            RequestAnimDict("anim@amb@clubhouse@tutorial@bkr_tut_ig3@")
                            while not HasAnimDictLoaded("anim@amb@clubhouse@tutorial@bkr_tut_ig3@") do
                                Citizen.Wait(10)
                            end
                            TaskPlayAnim(PlayerPedId(), "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", "machinic_loop_mechandplayer", 2.0, 2.0, 4000, 30, 0, 0, 0, 0)
                            Citizen.Wait(4000)
                            randomChance = math.random(1, 100)
                            randomWeapon = Config.WeaponLootObject[math.random(1, #Config.WeaponLootObject)]
                            randomItem = Config.ItemLootObject[math.random(1, #Config.ItemLootObject)]

                            if randomChance > 0 and randomChance < Config.ProbabilityWeaponLootObject then
                                local randomAmmo = math.random(1, 30)
                                GiveWeaponToPed(GetPlayerPed(-1), randomWeapon, randomAmmo, true, false)
                                ESX.ShowNotification('Buldun ' .. randomWeapon)
                            elseif randomChance >= Config.ProbabilityWeaponLootObject and randomChance < Config.ProbabilityMoneyLootObject then
                                TriggerServerEvent('esya_arama:moneyloot')
                            elseif randomChance >= Config.ProbabilityMoneyLootObject and randomChance < Config.ProbabilityItemLootObject then
                                TriggerServerEvent('esya_arama:itemloot', randomItem)
                            elseif randomChance >= Config.ProbabilityItemLootObject and randomChance < 100 then
                                ESX.ShowNotification('Hiç Birsey Bulamadın')
                            end
                            objects[obj] = true
                           end
                    end
                end
            end
            Citizen.Wait(sleep)
        end
    end)
end
Teşekkür Ederim Öğreneceğim :)
 
Kodu bu şekilde kullanman ciddi anlamda optimizasyon artışı sağlıcaktır. Sleep çok basit bir method öğrenmeni tavsiye ederim.


C#:
ESX = nil

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

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
    PlayerData = xPlayer
end)

objects = {}

if Config.ObjectDropLoot then
    Citizen.CreateThread(function()
        while true do
            local sleep = 1250
            for k,v in pairs(Config.ObjectsLoot) do
                    local player = GetPlayerPed(-1)
                    local distanceobject = 2.2
                    local obj = GetClosestObjectOfType(GetEntityCoords(player).x, GetEntityCoords(player).y, GetEntityCoords(player).z, distanceobject, v, false, true ,true)
                    local distance = GetDistanceBetweenCoords(GetEntityCoords(player), GetEntityCoords(obj), true)
           
                if distance <= distanceobject then
                    sleep = 3

                    local ObjectCoords = GetEntityCoords(obj)

                    if not objects[obj] then
                    ESX.Game.Utils.DrawText3D(ObjectCoords + vector3(0.0, 0.0, 0.5), '~c~ARAMAK IÇIN ~b~[E]~c~ TUSUNA BAS', 1, 4)
                    end

                    if IsControlJustReleased(0, 38) then
                        if not objects[obj] then

                            SetCurrentPedWeapon(GetPlayerPed(-1), 0xA2719263, true)
                            RequestAnimDict("anim@amb@clubhouse@tutorial@bkr_tut_ig3@")
                            while not HasAnimDictLoaded("anim@amb@clubhouse@tutorial@bkr_tut_ig3@") do
                                Citizen.Wait(10)
                            end
                            TaskPlayAnim(PlayerPedId(), "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", "machinic_loop_mechandplayer", 2.0, 2.0, 4000, 30, 0, 0, 0, 0)
                            Citizen.Wait(4000)
                            randomChance = math.random(1, 100)
                            randomWeapon = Config.WeaponLootObject[math.random(1, #Config.WeaponLootObject)]
                            randomItem = Config.ItemLootObject[math.random(1, #Config.ItemLootObject)]

                            if randomChance > 0 and randomChance < Config.ProbabilityWeaponLootObject then
                                local randomAmmo = math.random(1, 30)
                                GiveWeaponToPed(GetPlayerPed(-1), randomWeapon, randomAmmo, true, false)
                                ESX.ShowNotification('Buldun ' .. randomWeapon)
                            elseif randomChance >= Config.ProbabilityWeaponLootObject and randomChance < Config.ProbabilityMoneyLootObject then
                                TriggerServerEvent('esya_arama:moneyloot')
                            elseif randomChance >= Config.ProbabilityMoneyLootObject and randomChance < Config.ProbabilityItemLootObject then
                                TriggerServerEvent('esya_arama:itemloot', randomItem)
                            elseif randomChance >= Config.ProbabilityItemLootObject and randomChance < 100 then
                                ESX.ShowNotification('Hiç Birsey Bulamadın')
                            end
                            objects[obj] = true
                           end
                    end
                end
            end
            Citizen.Wait(sleep)
        end
    end)
end
ab pm bakar mısın forum üzerinden birşey yazdım da
 

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!