OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bardosy on 19 Sep 2005, 07:23:02
-
I want a trigger witch start when player take an R109 radio (RHS addon) (class name: LSR_R109).
I try this:
contition: player hasWeapon "LSR_R109"
But daes happen nothing. If I changed the radio to a real weapon (eg: RHS_AK47) it's working.
How can I detect, the player take a radio?
-
try adding parenthases:
(player hasWeapon "LSR_R109")
-
or perhaps you have the classname wrong?
-
Tyger: parenthases???? Why? What's the differente? But I'll try...
Triggerhappy: if the class name was not coorect, there may be en error message. But I'm sure, the classname is LSR_R109...
-
Sometimes it just needs parenthases to work.
Try using addWeapon "LSR_R109" to see if that is the correct class name.
If it is and parens don't work either, then your version of OFP is *(#$ed up ;D
-
if you want to be sure of the classname, make a radio trigger:
on activation: hint format ["%1",(weapons player)]
then drop everything but the radio and radio away
-
Well I am 0 for 1 today but at some point I have got to get something right.
Could it be that a radio is a secondary weapon so you will need to do something like:
(player secondaryWeapon) == "LSR_R109"
Syntax may be wrong but the concept is sound.
Wadmann
-
Well I am 0 for 1 today but at some point I have got to get something right.
Could it be that a radio is a secondary weapon so you will need to do something like:
(player secondaryWeapon) == "LSR_R109"
Syntax may be wrong but the concept is sound.
Wadmann
That will work, but the point is hasweapon SHOULD work for ANY weapon (I know it works for secondary weapons, I have tried it). And those aren't the only ways either, you can use the weapon command, and there are probably even a few other methods. I mean detecting if a unit has a specific weapon is one of the easiest things to do, I can't believe its not working, unless you have the wrong classname.
-
So in the end, are you 110% sure it's the right classname?
(Not meaning to offend you with that ;) )
-
Master Tyger! You are the hero of the day!!!!
With parenthases it's working! Thanks a lot!
What a madness... with real weapon (like AK) working without parenthases, but
radio works only with parenthases. But finally working.
Thanks a lot again!
-
That's OFP for you. :gunman: