Jump to content

[Help] onPlayerWasted


Vegastr

Recommended Posts

Hello everyone. I have a question about strange situation with onPlayerWasted event.
 

addEventHandler( "onPlayerWasted", getRootElement( ),
    function(ammo,killer,weapon,bodypart)
        if killer and getElementType(killer) == "player" then
            outputChatBox("PLAYER")
            local faction = tonumber(getElementData(killer,"faction"))
                if faction and isFactionActiveWar(faction) then
                    addKillToGangWar(faction)
                end
        end
    end
)

 

When player killed by shot in the head, killer type is boolean, but if shot was in the body, killer is player.

Idk how to fix it and why this event returnes thet exception result

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