Jump to content

LUA et_Obituary


TimOOn

Recommended Posts

Hello,

 

I was playing with et_Obituary function recently and I tried to replace obituary message with my own. It doesn't work the way I expected. If a string is returned from this function it does replace default obituary, but message is displayed on chat area instead of cpm (popup) like other obituaries.

 

Is there a way to print custom obituaries on cpm area? I know I could use "et.trap_SendServerCommand" to do that but it won't overwrite the original message, so both of them will be printed.  :unsure:

Link to comment
Share on other sites

It is no problem to creat obituaries for killing myself...

but how to add killer name if i'm killed by someone?

 

like in ETPUB 0.9.1:

 

set g_obit206 "[v]^7 was killed by [a]^7's knife."

 

but in silent i want to do it by lua..

can someone explain me?

Edited by Kynval
Link to comment
Share on other sites

But i'm not too good with lua's, so please make a one explain for me :)

 

 

if victim == killer and meansOfDeath == 206 then

customObit = "^7%s ^zwas killed by" ..killername.. "by knife." 
return string.format(customObit, et.gentity_get(victim, "pers.netname"))
end

?

 

And where can I find full list of Obituaries ?

Edited by Kynval
Link to comment
Share on other sites

  • Management

Just read the links I posted, it is very clear then. I agree that creating a Lua script is a bit more work. The reasons why we remove certain abilities that were in ETPub, has been to make the experience more consistent to players. Also, some features were pretty much experimental. Couple mistakes were made, but this is not one of those. If you are new to scripting, please read a Lua tutorial first. It will be easy then and Lua is very easy scripting language.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...