Advertisement

Author Topic: ADDACTION IN MP  (Read 549 times)

0 Members and 1 Guest are viewing this topic.

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
ADDACTION IN MP
« on: 23 Jun 2004, 14:31:26 »
I'm having difficulties making the addAction work properly in MP missions when I die.. Seems the addAction sticks with the dead body, and activates on the player only when he is near - and pointing towards the dead body...!

I'm also having problems using removeAction on the dead body... (I'm tryinging to remove the action when the player dies, and then reassign the action when the player respawns.)

What the *BIIP* am I doing wrong?

ZNorQ

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:ADDACTION IN MP
« Reply #1 on: 23 Jun 2004, 16:35:48 »
Remove and add the actions via a script run from the Addevent "Killed"

eg

INIT.SQS
Quote
player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
? (Player == W1):IamMortar = true
?(IamMortar):gunaction = (Player AddAction ["Setup .Mortar","Mortar.sqs"])

PLAYERKILLED.SQS
Quote
player removeAllEventHandlers "killed"
?(IamMortar):player removeAction gunaction

@ Alive Player
player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
? (IamMortar):gunaction = (Player AddAction ["Setup .Mortar","Mortar.sqs"])


create a boolean for the guy you want to have the action, example shown above

Then for the rest of the mission, you can call on the boolean to run a command for only that player
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
Re:ADDACTION IN MP
« Reply #2 on: 23 Jun 2004, 21:13:35 »
Terox, you saved my life - yet again!

Thx mate!

(I'm a big fan of addEventHandler now! :D)

ZNorQ