announce players hp left

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

cwG`Mummy
Posts: 15
Joined: Fri Aug 12, 2005 3:40 pm
Contact:

announce players hp left

Post 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 :)
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Re: announce players hp left

Post 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.
send lawyers, guns and money
cwG`Mummy
Posts: 15
Joined: Fri Aug 12, 2005 3:40 pm
Contact:

Re: announce players hp left

Post 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
83.243.82.119:27960 cwG`House Of Frags
Phenomenon
Posts: 5
Joined: Wed Jul 05, 2006 3:01 am

Re: announce players hp left

Post 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
cwG`Mummy
Posts: 15
Joined: Fri Aug 12, 2005 3:40 pm
Contact:

Re: announce players hp left

Post 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
83.243.82.119:27960 cwG`House Of Frags
Phenomenon
Posts: 5
Joined: Wed Jul 05, 2006 3:01 am

Post by Phenomenon »

simply add

Code: Select all

set lua_modules "playsound.lua announcekillershealth.lua"
to your config
cwG`Mummy
Posts: 15
Joined: Fri Aug 12, 2005 3:40 pm
Contact:

Post 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:)
83.243.82.119:27960 cwG`House Of Frags
User avatar
ReyalP
Posts: 1663
Joined: Fri Jul 25, 2003 11:44 am

Re: announce players hp left

Post 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.
send lawyers, guns and money
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post 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
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post 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
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

thanks McSteve going soon to use it,

btw McSteve fixed bug with minus hp.

regards

and thanks again for your help McSteve :)
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

Cool, can you post it and share?
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post 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...
wolFTeam.pl
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post 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
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post 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.
GhosT:McSteve
Ghostworks Gaming Community
Post Reply