OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SgtBaker1112 on 27 Sep 2006, 02:24:44
-
Can someone help me out here.. i am trying to add an eventhandler to spawned unit
"z_priest" createunit [getpos die1,ja,"BOBs=this"]
how would i go about adding an eventhandler killed, then exec "isdead.sqs"
-
Three possibilities in order they should be executed next time...
1) Search the forums
2) Read the CreateUnit tutorial
3) Ask Mr.Peanut "xxxx" createUnit [_pos,_grp,{BOBs=this ; this addEventHandler ["killed",{_this exec "enemykill.sqs"}]},0.5,"PRIVATE"]
If the script "enemykill.sqs" or "isdead.sqs" or whatever you call it _this select 0 will be the dead unit.
-
1. i have searched.. i even looked some more after your reply, but i still couldn't find what i was looking for
2. I have found no createunit tutorial.. can i have a link?
3. i appreciate you trying to help me. but the code sample has given me an error Missing )
:banghead:
-
Here is the CreateUnit Tutorial (http://www.ofpec.com/forum/index.php?topic=28040.0).
Planck
-
I just took a look at my code above and saw an extra double quote. I have removed it from post above. Try again.
-
thank you mr.peanut.. i now see you as a scripting god.
it worked!!!!!1
:clap:
:clap:
:laugh:
:blink:
:)
-
!Supplicate Before the Mighty Nut!
(http://www3.ns.sympatico.ca/brendan.detracey/notworthy.gif)
actually, i am not a god, i am just good at searching the forums ;)