Jump to content

MTA DAYZ, Can't dead,suicide, or something like that.


RobbyAJM

Recommended Posts

Spoiler

addEventHandler ( "onClientPlayerDamage", getLocalPlayer (), playerGetDamageDayZ )

function pedGetDamageDayZ ( attacker, weapon, bodypart, loss )
    cancelEvent()
    if attacker and attacker == getLocalPlayer() then
        damage = 100
        if weapon == 37 then
            return
        end
        if weapon == 63 or weapon == 51 or weapon == 19 then
            setElementData(source,"blood",0)
            if getElementData(source,"blood") <= 0 then
                triggerServerEvent("onZombieGetsKilled",source,attacker)
            end
        elseif weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then
            damage = getWeaponDamage (weapon)
            if bodypart == 9 then
                damage = damage*1.5
                headshot = true
            end
            setElementData(source,"blood",getElementData(source,"blood")-math.random(damage*0.75,damage*1.25))
            if getElementData(source,"blood") <= 0 then
                triggerServerEvent("onZombieGetsKilled",source,attacker,headshot)
            end
        end
    end    
end

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

That my survivorSystem_client, can you tell me which script must fixed?

Link to comment

Try this one (not sure):

addEventHandler ( "onClientPlayerDamage", getLocalPlayer (), playerGetDamageDayZ )

function pedGetDamageDayZ ( attacker, weapon, bodypart, loss )
    cancelEvent()
    if attacker and attacker == getLocalPlayer() then
        damage = 100
        if weapon == 37 then
            return
        end
        if weapon == 63 or weapon == 51 or weapon == 19 then
            setElementData(source,"blood",0)
            if getElementData(source,"blood") <= 0 then
                triggerServerEvent("kilLDayZPlayer",source,attacker)
            end
        elseif weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then
            damage = getWeaponDamage (weapon)
            if bodypart == 9 then
                damage = damage*1.5
                headshot = true
            end
            setElementData(source,"blood",getElementData(source,"blood")-math.random(damage*0.75,damage*1.25))
            if getElementData(source,"blood") <= 0 then
                triggerServerEvent("kilLDayZPlayer",source,attacker,headshot)
            end
        end
    end    
end

 

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...