Home   Help Search Login Register  

Author Topic: Script not working after respawn  (Read 1206 times)

0 Members and 1 Guest are viewing this topic.

WimpBastard

  • Guest
Script not working after respawn
« on: 10 Apr 2005, 08:07:13 »
I'm making a mission based off the movie Predator, one guy hunts down everyone else with the help of the optical camo.

One of the SF guys is a minigunner and i made a quick script so he could replenish his ammo.
Code: [Select]
minigunner addmagazine "hh_minigun"
minigunner addmagazine "hh_minigun"
minigunner addmagazine "hh_minigun"
minigunner addmagazine "hh_minigun"
minigunner addmagazine "hh_minigun"
minigunner selectweapon "hh_minigun"

and in the init.sqs
Code: [Select]
minigunner addaction ["MORE AMMO!!!!", "moreammo.sqs"]
That works, he can run around, spray bullets everywhere and when he runs out he can hit MORE AMMO!! and he gets a whole new set of minigun mags. If he gets shot though and respawns, the MORE AMMO!!! script doesnt work anymore, it does work on the minigunners corpse though.

How do i make my script apply to the newly respawned minigunner?

StonedSoldier

  • Guest
Re:Script not working after respawn
« Reply #1 on: 10 Apr 2005, 12:28:56 »
i guess since your using an addaction the minigunner must be a player so why not
use player instead of minigunner

Offline Speeder

  • Members
  • *
    • OFP.nu
Re:Script not working after respawn
« Reply #2 on: 20 Apr 2005, 10:29:43 »
The unit name - Minigunner does no longer exist when the unit dies. You must use the Player variable instead, as it will allways be the same as long as the game is only played by 1 person. When Multiplaying the Player Variable will be different on each machine as all playing humans has an active player variable on their local machine.

otherwise you could use a  trigger to make List over all units on one side, and then for each of those units give him the action More Ammo. But then requires that alle units has the same weapon.


There are 10 kinds of people in this world. Those who get it, and those who don't.