Home   Help Search Login Register  

Author Topic: Weapon Active  (Read 485 times)

0 Members and 1 Guest are viewing this topic.

fragger

  • Guest
Weapon Active
« on: 06 Jul 2004, 17:37:29 »
I want to make a script which detects if the player has a handgun in his hand. I dont want the script activated if the weapon is holstered, only when the player has the weapon in his hand.


Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Weapon Active
« Reply #1 on: 06 Jul 2004, 18:58:03 »
you could use a fired addeventhandler, obviously that would only activate if the player used it



maybe
Start with an M16 and then
take a handgun out of an ammo crate and then see what is returned in the following looping script

Quote
#START
~5
_weapon = Primaryweapon player
Hint format ["Weapon is %1",_weapon]
goto "START"

if the hint returns
Weapon is "Beretta"

then you could use the following query line in a looping script etc etc

?(primaryweaponplayer == "Beretta"): Do whatever



unchecked dont know if _weapon would return the weapon he was using or the assault rifle

try it and see
« Last Edit: 06 Jul 2004, 18:58:19 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

fragger

  • Guest
Re:Weapon Active
« Reply #2 on: 06 Jul 2004, 19:43:18 »
Thx for the reply,
It does work but it only returns the name of the assault rifle, not the pistol.
What else is there which I could put instead of primaryweapon, to refer to the pistol? If this can't be done, i'll probably just have to stick to using a fired eventhandler.

rOk

  • Guest
Re:Weapon Active
« Reply #3 on: 06 Jul 2004, 20:05:25 »
I know for a fact that this can be done. Don't know how though, 'cos I only played the mission which uses the same principles.

You had to sneak up on the boss with your weapon holstered(past his guards), then you killed him, and then the guards started chasing you.

For any second thoughts, It didn't work with the variable "boss killed", cos I tried it, took out the gun in front of the guards (with boss alive), waited a little and then they shot me dead.

Offline Blanco

  • Former Staff
  • ****
Re:Weapon Active
« Reply #4 on: 06 Jul 2004, 20:24:55 »
Search or search or search before you ask.