OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Aquaphonic on 16 Jul 2004, 00:43:27

Title: Weapon Problem
Post by: Aquaphonic on 16 Jul 2004, 00:43:27
I am currently making a map where I have a unit who has setcaptive true. When my unit picks up a weapon (AK47 lets say) setcaptive changes to false.

My problem is I would like setcaptive to be changed back to true when my unit drops his weapon.

Any help most appreciated.
Title: Re:Weapon Problem
Post by: macguba on 16 Jul 2004, 01:15:19
? (primaryWeapon loon1) != "AK74": loon1 setCaptive true

Syntax etc not guaranteed.
Title: Re:Weapon Problem
Post by: Artak on 16 Jul 2004, 01:35:37
Would PrimaryWeapon return null if he had none? Try null and objnull pharhaps. That way it should work with any weapon. But I'm just talking what I'm thinking, so don't call me a liar if it doesn't work.

#loopadoo
? (primaryWeapon loon1) != "null": loon1 setCaptive true
~1
goto "loopadoo"
Title: Re:Weapon Problem
Post by: Aquaphonic on 16 Jul 2004, 02:46:04
Thank you both for your promt replies, everything works as I want it to.

I'll be keeping those bits of code in my snippets from now on.

Cheers!