Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Lua hooks help
Lua hooks help [message #449077] Fri, 24 June 2011 12:13 Go to next message
hego64 is currently offline  hego64
Messages: 19
Registered: April 2011
Location: Hegoville
Karma: 0
Recruit
Is it possible to have something like a die hook? What I want is for a bunch of players to be in spectate mode. When a player not in spectate mode dies, he/she turns into a spectator and someone else in spectate mode dies and spawns to take their place. I'm not sure how to do this, or if it is even possible. Any help would be appreciated Very Happy

Thanks,
Hego64
Re: Lua hooks help [message #449078 is a reply to message #449077] Fri, 24 June 2011 13:00 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
I'm not familiar with the LUA plugin but if you do it via C++ you can create and attach a script and in the ::Killed() event do that kind of stuff. Does the LUA plugin allow you to create scripts?

Oh and in the A Path Beyond Gamma mod (which includes a build of scripts 4.0) there's an issue with using the normal spectate code, if you put someone in spectate in that mod, players will see the name tag of the player in spectate floating around where the player is located. So when scripts 4.0/TT patch gets released in the future, Renegade players will probably also be able to see the name tag of the guy in spectate.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Fri, 24 June 2011 13:03]

Report message to a moderator

Re: Lua hooks help [message #449087 is a reply to message #449078] Sat, 25 June 2011 02:52 Go to previous messageGo to next message
sla.ro(master) is currently offline  sla.ro(master)
Messages: 610
Registered: September 2010
Location: Romania
Karma: 0
Colonel
iRANian wrote on Fri, 24 June 2011 23:00

I'm not familiar with the LUA plugin but if you do it via C++ you can create and attach a script and in the ::Killed() event do that kind of stuff. Does the LUA plugin allow you to create scripts?

Oh and in the A Path Beyond Gamma mod (which includes a build of scripts 4.0) there's an issue with using the normal spectate code, if you put someone in spectate in that mod, players will see the name tag of the player in spectate floating around where the player is located. So when scripts 4.0/TT patch gets released in the future, Renegade players will probably also be able to see the name tag of the guy in spectate.


Lua 4/5 supports Scripts, you can attach a script to all Players and use killed hook call from the script, is easy and yes you can see spectate on 4.0, i tested it on mutant co-op and i saw one of mods flying around me, lol


Creator of Mutant Co-Op
Developer of LuaTT
icon2.gif  Re: Lua hooks help [message #449101 is a reply to message #449087] Sat, 25 June 2011 09:25 Go to previous messageGo to next message
hego64 is currently offline  hego64
Messages: 19
Registered: April 2011
Location: Hegoville
Karma: 0
Recruit
Can you give me an example of how to write this in Lua then? I don't know how to make a kill hook, so that when someone dies, a spectator is killed and spawns. I also need to know how to make it so that when people join, all but 2 people are sent to spectate mode. Help!

Thanks,
Hego64
Re: Lua hooks help [message #449171 is a reply to message #449101] Mon, 27 June 2011 00:23 Go to previous message
sla.ro(master) is currently offline  sla.ro(master)
Messages: 610
Registered: September 2010
Location: Romania
Karma: 0
Colonel
i can't atm Sad , i'm very busy with TTW, Sla Lua IRC Bot, Lua SSGM ,lol

try contact jnz, he will help ya Wink


Creator of Mutant Co-Op
Developer of LuaTT
Previous Topic: C&C Renegade CNC 3 Background Earth
Next Topic: Creating an object with the string name "Proxy C4"
Goto Forum:
  


Current Time: Wed Dec 18 04:00:03 MST 2024

Total time taken to generate the page: 0.00644 seconds