script question [message #302180] |
Sun, 09 December 2007 19:37 |
neofmat
Messages: 42 Registered: February 2005
Karma: 0
|
Recruit |
|
|
Is there an event I can catch when a vehicle is hit by a weapon ? I need to run a script on the vehicle that is being hit b a new weapon. Can someone please post a sample script or explain how this can be acomplished ?
Thanks.
RxD
http://www.renxtreme.info
|
|
|
Re: script question [message #302239 is a reply to message #302180] |
Mon, 10 December 2007 07:56 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
The closest one I can think of is the Damaged() function..
(.h file)
class some_Class : public ScriptImpClass {
void Created(GameObject *obj);
void Damaged(GameObject *shooter, float damage, GameObject *obj); // I forget the other param :P
};
(.cpp file)
void some_Class::Damaged(GameObject *shooter, float damage, GameObject *obj)
{
// code here.
}
I don't know if you can find out what weapon the person is hold when they fired those shots, but I believe you'd use the Damaged function above ^^
~MathK1LL
|
|
|
|
Re: script question [message #302418 is a reply to message #302180] |
Mon, 10 December 2007 20:27 |
|
The closest you can get to knowing who/what did the damage/kill is the way I have done it in the script JFW_Kill_Message_Display in jfwdmg.cpp
Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
|
|
|