Jump to content

Killed by


Trilon

Recommended Posts

Fist, what you did is gonna send erros plus will not output the message to the player who dead and who killed

function outPutKillerName(source, killer) 
    outputChatBox( source.." died from hands of "..killer ) 
end 
addEventHandler( "onPlayerWasted", getRootElement(), outPutKillerName ) 

Here is the right way to do this killed by script

function outPutKillerName( _, killer) 
   if ( killer and getElementType ( killer ) == "player" and killer ~= source ) then 
    outputChatBox( getPlayerName(source).." died from hands of "..getPlayerName(killer) ) 
 else 
    outputChatBox ( getPlayerName(source).." died." ) 
    end 
end 
addEventHandler( "onPlayerWasted", root, outPutKillerName ) 

Edited by Guest
Link to comment
Fist, what you did is gonna send erros plus will not output the message

Here is the right way to do this killed by script

function outPutKillerName( _, killer) 
   if ( killer and getElementType ( killer ) == "player" and killer ~= source ) then 
    outputChatBox( getPlayerName(source).." died from hands of "..getPlayerName(killer) ) 
 else 
    outputChatBox ( getPlayerName(source).." died." ) 
    end 
end 
addEventHandler( "onPlayerWasted", root, outPutKillerName ) 

yes myb, but havent tested it cause i was making script only wanted to help.

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