Home   Help Search Login Register  

Author Topic: Need help to check weapon  (Read 747 times)

0 Members and 1 Guest are viewing this topic.

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Need help to check weapon
« on: 26 Mar 2005, 14:43:36 »
Hi i need help, i have a script where at the end of it, i made the player have 2 mines, and i gave the player a waypoint to plant it over the bridge..

How do i make it so that when the player have no mines, a script will activate? Thxs in advance

Silencer

  • Guest
Re:Need help to check weapon
« Reply #1 on: 26 Mar 2005, 14:52:11 »
use the hasweapon command?

? (player hasWeapon "Mine") : Exit
[] exec "yourscript.sqs"

Maybe you should use a count to know if he has more mines

Good luck
« Last Edit: 26 Mar 2005, 14:55:28 by Silencer »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Need help to check weapon
« Reply #2 on: 26 Mar 2005, 14:53:09 »

Offline Woodpeckersam

  • Members
  • *
  • I'm a llama! ooh! Yeah!
Re:Need help to check weapon
« Reply #3 on: 26 Mar 2005, 15:10:51 »
I did check the comref but i saw the word weapon but mine is known as a magazine so... i thought it would not work. But thanks!

So now this is what my script looks like. is it Correct?

Code: [Select]
_plyr = _this select 0
~0.1
goto mine

#mine
_plyr domove getpos flagg
? (_plyr hasWeapon "Mine") : goto "nomine"
goto mine

#nomine
nomine = true
exit
« Last Edit: 26 Mar 2005, 15:16:50 by Woodpeckersam »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Need help to check weapon
« Reply #4 on: 27 Mar 2005, 01:23:10 »
You've kind of got the right idea... ;)

As far as OFP is concerned, a mine isn't technically a weapon. The weapon used to 'fire' the mine is "put".

So you need to check the unit's magazines. Try this:

? ("Mine" in magazines unit): run script/etc.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Need help to check weapon
« Reply #5 on: 27 Mar 2005, 10:23:53 »
Quote
and i gave the player a waypoint to plant it over the bridge..
Your mission will be non-functional in Veteran mode.    And a little dull in Cadet mode.

Use the Briefing, cutscenes, radio sidechat or some other method to tell the player that he must plant mines on the bridge.    Waypoints should be only a bonus for Cadets.   Good waypoint are precise enough to be helpful, but vague enough to prevent the mission from being just a prescriptive list of instructions.
Plenty of reviewed ArmA missions for you to play