Jump to content

مساعدة


Recommended Posts

شباب بدي لما اضرب هيدشوت بالأسلحة الموجودة في الجدول
اللاعب يموت على الفور و ينقطع رأسه
و بقية الأسلحة تزيل 80 dmg

في الهيدشوت
هذا كودي وين المشكلة ؟

local removeHeadOnHeadshot = true

local function onPlayerDamage(attacker, weapon, bodypart, loss)
        local allowedWeapons = {
            [24] = true, 
            [25] = true,  
            [33] = true,  
            [34] = true   
        }
    if bodypart == 9 then


        if isElement(source) and getElementType(source) == "ped" then
            if allowedWeapons[weapon] then
                setElementHealth(source, 0)  
                if removeHeadOnHeadshot then
                    setPedHeadless(source, true)  
                end
            else

                loss = 80
                setElementHealth(source, getElementHealth(source) - loss)
            end
        end
    end
end

addEventHandler("onPlayerDamage", root, onPlayerDamage)

 

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...