Home   Help Search Login Register  

Author Topic: automatic reammo  (Read 718 times)

0 Members and 1 Guest are viewing this topic.

Offline FiLL2d

  • Members
  • *
  • X.x
automatic reammo
« on: 05 Sep 2005, 12:50:25 »
Hi, I need help with a script I'm doing for my map, but I have a few questions.

1) Is there a way ofp can detect when your m16 is completely used up, and then add 3 more magazines automatically, so you never run out?

2) Is there a way I can make a trigger only activate 5 times - because im wanting soon as a civilian runs into it for it to count 1, then if a second runs into it for it to count 2 and so on till it reaches 5, then the game must end.

3) I need to be able to detect when a list of 10 civilians are dead by the name of civ1-10 so when they all die, only when they all die, I can create more civilians.

Thanks if anyone can help me with any of those, I appreciate it!

Silencer

  • Guest
Re:automatic reammo
« Reply #1 on: 05 Sep 2005, 14:24:24 »
Answer 1: http://www.ofpec.com/editors/comref.php?letter=A#ammo
Answer 2: Maybe use a Loop in your script
Answer 3: I think you need to take a look at eventhandlers:
http://www.ofpec.com/editors/comref.php?letter=A#addEventHandler

Good luck

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:automatic reammo
« Reply #2 on: 05 Sep 2005, 14:24:27 »
1.
Code: [Select]
if not ("M16" in magazines player) then {player addMagazine "M16;player addMagazine "M16;player addMagazine "M16}or some such

2. Condition field: this and trigCounter <5
Activation field trigCounter = trigCounter + 1

don't forget to set trigCounter = 0 at the start of the mission

3.
Code: [Select]
_listOfCivis = [civ1,civ2,civ3,...civ10]
if ({alive _x} count _listOfCivis < 1} then {hint£they are all dead"} else {hint "no they arn't"}
« Last Edit: 05 Sep 2005, 14:25:03 by THobson »

Offline FiLL2d

  • Members
  • *
  • X.x
Re:automatic reammo
« Reply #3 on: 05 Sep 2005, 14:36:26 »
thanks so much guyz!