William147 Posted April 17, 2016 Posted April 17, 2016 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)
William147 Posted April 18, 2016 Author Posted April 18, 2016 in other script works with "thePlayer" No error/warning!
Seba500PLK Posted April 18, 2016 Posted April 18, 2016 wait, add addEvent("kilLDayZPlayer",true) above addEventHandler
Anubhav Posted April 19, 2016 Posted April 19, 2016 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)
Captain Cody Posted April 19, 2016 Posted April 19, 2016 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now