Jump to content

getElementData problem


William147

Recommended Posts

Posted

Hello!

I would like to call killer's element data and killed player's element data but it isn't works!

What is the problem?

  
function call(killer) 
    local killername = getPlayerName ( killer ) 
    local sourcename = getPlayerName ( source ) 
    local killergroup = getElementData(killer,"NameGroup") 
    local killedgroup =  getElementData ( source, "NameGroup" ) 
    if killer then 
        outputChatBox(killername.."'s group: "..tostring(killergroup).." "..sourcename.."'s group:"..tostring(killedgroup)) 
    end 
end 
addEventHandler("kilLDayZPlayer", getRootElement(), call) 
  

Posted

Stop over-writing MTA's main functions.

  
  
function cal(killer) 
    local killername = getPlayerName ( killer ) 
    local sourcename = getPlayerName ( source ) 
    local killergroup = getElementData(killer,"NameGroup") 
    local killedgroup =  getElementData ( source, "NameGroup" ) 
    if killer then 
        outputChatBox(killername.."'s group: "..tostring(killergroup).." "..sourcename.."'s group:"..tostring(killedgroup)) 
    end 
end 
addEvent("kilLDayZPlayer", true) 
addEventHandler("kilLDayZPlayer", getRootElement(), cal) 
  

Posted

If it appears blue ,red, or something else other then black then its a default function don't use it, or if you don't use notepad++ or something similar with the mta functions defined, think to yourself, would this function ever be used by the default game?

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