Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Bienvenue Guest!

Rejoignez la communauté pour avoir accès à l'entièreté du site! Une fois que vous serez enregistré, vous pourrez créer, aider, partager et discuter avec les membres de la communauté et également participer à l'amélioration du site. Alors, qu'attendez vous ? Enregistrez-vous !

Sign in to follow this  
Sarah

intermédiaire Un optimisé nonpcdrop

Recommended Posts

Sarah
Posted (edited)
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(1)
    -- List of pickup hashes (https://pastebin.com/8EuSv2r1)
    RemoveAllPickupsOfType(0xDF711959) -- carbine rifle
    RemoveAllPickupsOfType(0xF9AFB48F) -- pistol
    RemoveAllPickupsOfType(0xA9355DCD) -- pumpshotgun
  end
end) 

anciens code, le plus répandue  a  jeté a la poubelle 🤣

 

local pedindex = {}

function SetWeaponDrops() -- This function will set the closest entity to you as the variable entity.
    local handle, ped = FindFirstPed()
    local finished = false -- FindNextPed will turn the first variable to false when it fails to find another ped in the index
    repeat 
        if not IsEntityDead(ped) then
                pedindex[ped] = {}
        end
        finished, ped = FindNextPed(handle) -- first param returns true while entities are found
    until not finished
    EndFindPed(handle)

    for peds,_ in pairs(pedindex) do
        if peds ~= nil then -- set all peds to not drop weapons on death.
            SetPedDropsWeaponsWhenDead(peds, false) 
        end
    end
end


Citizen.CreateThread(function()
    while true do
        Citizen.Wait(500)
        SetWeaponDrops()
    end
end)

 

Edited by Sarah

Share this post


Link to post
Share on other sites
Kanda Sorata

Merci ! Essai d'expliqué un peu plus sur tes prochains partages, ce sera plus agréable ;)

Share this post


Link to post
Share on other sites
Sarah

daccord

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

En utilisant ce site, vous acceptez les présents règlements Terms of Use, Privacy Policy,Guidelines.