Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Low Health
Re: Low Health [message #325689 is a reply to message #315780] Wed, 09 April 2008 01:32 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
so it should work when i attached it there.

hm nice now i know how to attach scripts,
see im getting somewere.

also,
i will look if i can do anything to make it working.
in meanwhile i hope he will make his code working.


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

Re: Low Health [message #325692 is a reply to message #315780] Wed, 09 April 2008 03:27 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Yes, attaching a script there with one line stops you having to add that script to each player preset in level edit.
Obviously when the player dies the script is destroyed too, which is why that's a good place to add it, as it attaches to the player each time he is ::Created.

There are other ways and other places to attach sc ripts to a player, such as the m00_grant (can't remember the rest), but this is a good place as any I guess.



Re: Low Health [message #325693 is a reply to message #315780] Wed, 09 April 2008 03:28 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
void Player_Join_Hook(int i,const char *Nick) {
Commands->Attach_Script(Get_GameObj(i),"zbl_Health_Level","");

Doesnt Work
Re: Low Health [message #325699 is a reply to message #315780] Wed, 09 April 2008 04:39 Go to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
That's a terrible way to attach it to a player. When that code is called the player isn't always a GameObject * yet. He exists in the server but hasn't always loaded or the server hasn't created his object yet.
If you try to attach a script to him at that point you're not gauranteed it will attach.

Also, it will only attach it to him once, when he dies it wouldn't re-attach unless he left the server and re-joined.



[Updated on: Wed, 09 April 2008 05:11]

Report message to a moderator

Previous Topic: GDI Guard Tower(s)?
Next Topic: RenX - protected models?
Goto Forum:
  


Current Time: Fri Sep 06 10:01:24 MST 2024

Total time taken to generate the page: 0.00686 seconds