Joe Miller 0 Posted July 23, 2005 Hello , ive got a problem with create unit command: I want to create a unit with createunit which has in the init field a call to a script. Example of the init i need: [this] exec "findhim.sqs" But ive got a big problem. I've followed the instructions of command reference, but it still doesnt work. theese are the instructions: Create unit of given type. Format of unitInfo is: [pos,group,init,skill,rank] The example: 'SoldierWB' createUnit [getmarkerPos 'barracks',groupAlpha] Notes: init,skill, and rank are optional, default values are "",0.5,'PRIVATE' Try and do what i did, putting this init in the init field [this] exec "findhim.sqs" What i typed is: "SoldierESaboteurBizon" createUnit [getmarkerPos "mafiabase",mafia,"[this] exec "findhim.sqs"",1,"Private"]; But it still doesnt work! Help me please!! Share this post Link to post Share on other sites
Garcia 0 Posted July 23, 2005 Quote[/b] ]_unit = "SoldierESaboteurBizon" createUnit [getmarkerPos "mafiabase",mafia,"",1,"Private"] ~1 [_unit] exec "findhim.sqs" Share this post Link to post Share on other sites
raedor 8 Posted July 23, 2005 createUnit gives back nothing.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierESaboteurBizon" createUnit [getmarkerPos "mafiabase",mafia,"[this] exec {findhim.sqs}",1,"Private"]; Share this post Link to post Share on other sites
Joe Miller 0 Posted July 23, 2005 Thank you , now it works. I have another question: how can i put the condition: Unit killed by someone? For example the trigger wich activate only if a unit is killed by the player? Share this post Link to post Share on other sites
klavan 0 Posted July 24, 2005 You need an eventhandler. Take a look here for a good tutorial. Klavan Share this post Link to post Share on other sites