Home   Help Search Login Register  

Author Topic: secondary weapon  (Read 863 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
secondary weapon
« on: 21 May 2005, 20:16:49 »
okay ive seen this in a thread today and i thought this will be a good idea for my mission ive decided to make a trigger over a town wich is about 220 x 220 radius and when a soldier walks into it i want him to switch to his secondary weapon wich is a berreta and if he leaves i want him to switch back to his sniper rifle to add to realism a bit more.
How would this be done

voodzia

  • Guest
Re:secondary weapon
« Reply #1 on: 21 May 2005, 20:25:23 »
The first part is easy:

Code: [Select]
; change_weapon.sqs - to call - [soldier] exec "change_weapon.sqs"

_unit = _this select 0

_unit selectWeapon secondaryWeapon _unit
But how to detect that this soldier has left the trigger - I don't know.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:secondary weapon
« Reply #2 on: 21 May 2005, 20:32:58 »
You can't use the function secondaryWeapon with this...
What OFP understands with secondary weapon is the LAW/RPG etc slot, not the handgun...

What you can try (in the trigger) is:
Activation: the side you need
present
On Activation: (thislist select 0) selectWeapon "berettaName"
On Deact. : (thislist select 0) selectWeapon (primaryWeapon (thislist select 0))
if you are using an old OFP= On Deact. : (thislist select 0) selectWeapon "sniperRifleName"

I'm not sure that would work, and in any case it wont (most likely) work on player units...
« Last Edit: 21 May 2005, 20:34:39 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline 456820

  • Contributing Member
  • **
Re:secondary weapon
« Reply #3 on: 21 May 2005, 20:34:21 »
hey im going to try both of your ideas i dont need it to work on the player only my fellow sniper

voodzia

  • Guest
Re:secondary weapon
« Reply #4 on: 21 May 2005, 20:36:21 »
Oh, I'm sorry - I didn't know that :( And thank you for the info.

Offline 456820

  • Contributing Member
  • **
Re:secondary weapon
« Reply #5 on: 22 May 2005, 19:23:02 »
cheers seems to work