Page 1 of 2

announce players hp left

Posted: Wed Aug 16, 2006 6:43 am
by cwG`Mummy
Im runing two populers server in Norway. I was woundering if there is a way to get the server to tell how mutch hp the player had left, when you are killed by him


I see many players asking the other player how mutch hp he had left,after the duell.

so it would be nice to let the server tell it


And is there any map scripts that dont let players blow up the objectiv
so i can have on my frag server ?



And i was woundering if anyone can tell we what to change in fueldump.script so this change can be in my server

becuse we will keep the snow map but like to have this settings on it :)

// arni - 09.07.2006 - Added playerclips to avoid all sorts of fueljumps
// arni - 09.07.2006 - Added spawnpt 3 - depot, truck, 3 positions
// arni - 09.07.2006 - Broke one garage gate to only close half way




Mummy

84.49.16.39:27960 *CwG*House Of Frags
84.49.16.39:27961 *CwG*Fueldump 24/7

You are welcome to come and play with us here :)

Re: announce players hp left

Posted: Wed Aug 16, 2006 2:04 pm
by ReyalP
*CwG*Mummy wrote:Im runing two populers server in Norway. I was woundering if there is a way to get the server to tell how mutch hp the player had left, when you are killed by him


I see many players asking the other player how mutch hp he had left,after the duell.

so it would be nice to let the server tell it
You could proably do this with a lua mod
And is there any map scripts that dont let players blow up the objectiv
so i can have on my frag server ?
This should be very easy to do yourself.
And i was woundering if anyone can tell we what to change in fueldump.script so this change can be in my server
There are a lot of fueldump scripts, it's not clear which one you are talking about.

Re: announce players hp left

Posted: Thu Aug 17, 2006 3:09 am
by cwG`Mummy
ReyalP wrote:
*CwG*Mummy wrote:Im runing two populers server in Norway. I was woundering if there is a way to get the server to tell how mutch hp the player had left, when you are killed by him


I see many players asking the other player how mutch hp he had left,after the duell.

so it would be nice to let the server tell it
You could proably do this with a lua mod
And is there any map scripts that dont let players blow up the objectiv
so i can have on my frag server ?
This should be very easy to do yourself.
And i was woundering if anyone can tell we what to change in fueldump.script so this change can be in my server
There are a lot of fueldump scripts, it's not clear which one you are talking about.
Im talking about that i have this in my fueldump script today

// ============================================================================
// Map: Fueldump
// Last update : 16/06/03 Sock
// ============================================================================
// rain - Tue Sep 23 20:24:55 EDT 2003 - fixed setautospawns
// bani - Mon Jan 5 23:45:25 PST 2004 - allied spawn at garage commandpost
// mortis - Fri Jun 24 18:11:58 PDT 2005 - set allied autospawn to HQ by default at spline 73
// 2/3Soul - Sat Jan 15 17:12:56 GMT 2005 - east depot defences only partially constructable
// mortis - Thu Sep 15 20:30:20 PDT 2005 - merged 2/3 soul features and mortis features
// [C.W.G]Mummy - Thu jan 12 13:30:20 PDT 2006 - Add Stairs with Axis First Spawan :) www.cwg-et.com


And i woud like to have

// arni - 09.07.2006 - Broke one garage gate to only close half way
// arni - 09.07.2006 - Added playerclips to avoid all sorts of fueljumps
// arni - 09.07.2006 - Added spawnpt 3 - depot, truck, 3 positions


in it to :)


Mummy

Re: announce players hp left

Posted: Thu Aug 17, 2006 8:29 am
by Phenomenon
*CwG*Mummy wrote:I was woundering if there is a way to get the server to tell how mutch hp the player had left, when you are killed by him


I see many players asking the other player how mutch hp he had left,after the duell.

so it would be nice to let the server tell it
- save following code as announcekillershealth.lua to ur etpro folder

Code: Select all

function et_Obituary(victimnum, killernum, meansofdeath)
	local victimteam = tonumber(et.gentity_get(victimnum, "sess.sessionTeam"))
	local killerteam = tonumber(et.gentity_get(killernum, "sess.sessionTeam"))
	
	if victimteam ~= killerteam and killernum ~= 1022 then
		local killername = string.gsub(et.gentity_get(killernum, "pers.netname"), "%^$", "^^ ")
		local killerhp = et.gentity_get(killernum, "health")
		
		et.trap_SendServerCommand(victimnum, string.format("cp "^7Your ^7killer ^7%s ^7has ^7still ^o%d ^7health ^7points ^7remaining.\n"", killername, killerhp))
	end
end
- add set lua_modules "announcekillershealth.lua" to your server configuration
- restart your server

to display some other text to the victim feel free to edit line 9 ...

have phun

Re: announce players hp left

Posted: Thu Aug 17, 2006 10:05 am
by cwG`Mummy
Phenomenon wrote:
*CwG*Mummy wrote:I was woundering if there is a way to get the server to tell how mutch hp the player had left, when you are killed by him


I see many players asking the other player how mutch hp he had left,after the duell.

so it would be nice to let the server tell it
- save following code as announcekillershealth.lua to ur etpro folder

Code: Select all

function et_Obituary(victimnum, killernum, meansofdeath)
	local victimteam = tonumber(et.gentity_get(victimnum, "sess.sessionTeam"))
	local killerteam = tonumber(et.gentity_get(killernum, "sess.sessionTeam"))
	
	if victimteam ~= killerteam and killernum ~= 1022 then
		local killername = string.gsub(et.gentity_get(killernum, "pers.netname"), "%^$", "^^ ")
		local killerhp = et.gentity_get(killernum, "health")
		
		et.trap_SendServerCommand(victimnum, string.format("cp "^7Your ^7killer ^7%s ^7has ^7still ^o%d ^7health ^7points ^7remaining.\n"", killername, killerhp))
	end
end
- add set lua_modules "announcekillershealth.lua" to your server configuration
- restart your server

to display some other text to the victim feel free to edit line 9 ...

have phun
Tanks alot for this and it works but then my killingspree sounds stops working :(

I have this in my config

setl lua_modules "playsound.lua"
setl lua_modules "announcekillershealth.lua"
setl lua_allowedmodules ""

it this OK ?



Mummy

Posted: Thu Aug 17, 2006 10:46 am
by Phenomenon
simply add

Code: Select all

set lua_modules "playsound.lua announcekillershealth.lua"
to your config

Posted: Thu Aug 17, 2006 11:29 am
by cwG`Mummy
Phenomenon wrote:simply add

Code: Select all

set lua_modules "playsound.lua announcekillershealth.lua"
to your config
Tanks alot for this and it works:)

Re: announce players hp left

Posted: Thu Aug 17, 2006 5:11 pm
by ReyalP
*CwG*Mummy wrote:============================================================================
// Map: Fueldump
// Last update : 16/06/03 Sock
// ============================================================================
// rain - Tue Sep 23 20:24:55 EDT 2003 - fixed setautospawns
// bani - Mon Jan 5 23:45:25 PST 2004 - allied spawn at garage commandpost
// mortis - Fri Jun 24 18:11:58 PDT 2005 - set allied autospawn to HQ by default at spline 73
// 2/3Soul - Sat Jan 15 17:12:56 GMT 2005 - east depot defences only partially constructable
// mortis - Thu Sep 15 20:30:20 PDT 2005 - merged 2/3 soul features and mortis features
// [C.W.G]Mummy - Thu jan 12 13:30:20 PDT 2006 - Add Stairs with Axis First Spawan :) www.cwg-et.com


And i woud like to have

// arni - 09.07.2006 - Broke one garage gate to only close half way
// arni - 09.07.2006 - Added playerclips to avoid all sorts of fueljumps
// arni - 09.07.2006 - Added spawnpt 3 - depot, truck, 3 positions


in it to :)


Mummy
So find the relavent bits of mapscript code (using some kind of diff/merge tool) and merge them.

Posted: Wed Dec 27, 2006 4:55 pm
by Luk4ward
Due to other lua scripts i noticed that its possible to do such command, yes? Could be this available only for refs or rcons? So i will be able to add such command in etadmin format so only specific level got such option...

If any1 could help ill be appreciated


regards

Luke


/edited:

it should be some wait command before annoucing killer's hp because its overwritten by for example: you killed blabla

Posted: Fri Dec 29, 2006 8:43 am
by McSteve
Was chatting with Luk4ward today and he asked if the announcehp could be made into a command called via admin_mod rather than announced each time. Here ya go Luk4, probably full of bugs but just let me know and I'll iron them out.

am_announcehp.lua

Posted: Sun Dec 31, 2006 2:57 am
by Luk4ward
thanks McSteve going soon to use it,

btw McSteve fixed bug with minus hp.

regards

and thanks again for your help McSteve :)

Posted: Sun Dec 31, 2006 8:40 am
by McSteve
Cool, can you post it and share?

Posted: Sun Dec 31, 2006 12:26 pm
by Luk4ward
Luk4ward wrote:thanks McSteve going soon to use it,

btw McSteve fixed bug with minus hp.

regards

and thanks again for your help McSteve :)
McSteve wrote: Cool, can you post it and share?
I said that u have fixed this bug with minus hp :D, u know that im not in lua language atm...

Posted: Tue Jan 02, 2007 1:03 am
by Luk4ward
maybe this? As i said im not in lua atm..

Code: Select all

function et_Obituary(victimnum, killernum, meansofdeath)
   local victimteam = tonumber(et.gentity_get(victimnum, "sess.sessionTeam"))
   local killerteam = tonumber(et.gentity_get(killernum, "sess.sessionTeam"))
   
   if victimteam ~= killerteam and killernum ~= 1022 then
     
      local killername = string.gsub(et.gentity_get(killernum, "pers.netname"), "%^$", "^^ ")
      local killerhp = et.gentity_get(killernum, "health")
      

      end

      if (killerhp > 0) then
      
      et.trap_SendServerCommand(victimnum, string.format("cp \"^7Your ^7killer ^7%s ^7has ^7still ^o%d ^7health ^7points ^7remaining.\n\"", killername, killerhp))
        
      else

      et.trap_SendServerCommand(victimnum, string.format("cp \"^7Your ^7killer ^7%s ^7has ^7no ^7points ^7remaining.\n\"", killername))


  
    end
end
i know this is the easiest way...if u got better then pls share it ;p

Posted: Tue Jan 02, 2007 11:20 am
by McSteve
That looks like it'll do the trick. I think I'm going to add it to my server and so I should find any other bugs fairly quickly.