OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 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
-
The first part is easy:
; 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.
-
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...
-
hey im going to try both of your ideas i dont need it to work on the player only my fellow sniper
-
Oh, I'm sorry - I didn't know that :( And thank you for the info.
-
cheers seems to work