Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Script help.
Script help. [message #376165] Sat, 14 March 2009 08:58 Go to previous message
Mark72091 is currently offline  Mark72091
Messages: 12
Registered: August 2006
Karma:
Recruit
What I am trying to do is create a script that damages all players within a certain distance.


What I am working on is a beacon that does no damage when detonated but damages all players within X distance 2 damage every 2 seconds for 6 runs.


I have done some debugging and this is the section that is causing the problem.
Vector3	pos = Commands->Get_Position(obj);
GenericSLNode *x = BaseGameObjList->HeadNode;
while (x) {
  GameObject *o = (GameObject *)x->NodeData;
  if (o && Is_Soldier(o)) {
    if (Commands->Get_Distance(Commands->Get_Position(o),pos) < 100) {
      Commands->Apply_Damage(o,2.0f,"Laser_NoBuilding",false);
    }
  }
  x = x->NodeNext;
}


Attached is all of the code for the beacon.
  • Attachment: beacon.txt
    (Size: 3.13KB, Downloaded 121 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Predator Stealth?
Next Topic: max vehicles
Goto Forum:
  


Current Time: Thu Nov 28 05:47:06 MST 2024

Total time taken to generate the page: 0.00699 seconds