OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: GingaWRATH on 09 Jul 2005, 14:37:46

Title: !alive player with publicvariable?
Post by: GingaWRATH on 09 Jul 2005, 14:37:46

I have this trigger

Con: !alive player
onact: [] exec "script.sqs"


this triggers is Local, and I have publicvariables in the .sqs

and want the sqs to run on all machines but need to use this condition.

is there anyway of making !alive player Or a Trigger Public.
Title: Re:!alive player with publicvariable?
Post by: GingaWRATH on 09 Jul 2005, 14:49:58
Basically I want All clients on the server to see any msgs.

Im using Globalchat for my msgs but only the Player who died sees anything.
Title: Re:!alive player with publicvariable?
Post by: Terox on 09 Jul 2005, 14:58:12
1) attach a killed eventhandler to the Players
2) When killed have the eventhandler make a boolean true and publicvariable it
3) Have a trigger waiting on that boolean to become true
4) Have the activation field of the trigger run a script
5) For repeating purposes, have the trigger script reset the boolean to false

eg


INIT.SQS
Quote
tx_dead = false
player addEventHandler ["killed", {tx_dead = true; Publicvariable "tx_dead"}]

TRIGGER
Quote
Activated by: Nobody
Set To: Repeatedly
Condition: tx_dead
On activation: [] exec "Alive.sqs"

Alive.sqs
Quote
tx_dead = false
add your own lines of code here
exit
Title: Re:!alive player with publicvariable?
Post by: GingaWRATH on 09 Jul 2005, 15:21:33
Brilliant Worx great Thanx Now I can goto sleep.. ;D