horror1 10 Posted September 13, 2010 hello im looking for a good and easy script to recruit ai soldiers in a mp mission. it should restrict the groupsize and allow only 1 recruiting action till player dies and respawns and ai should be deleted when player leaves . any hint is much apreciated Share this post Link to post Share on other sites
kylania 567 Posted September 13, 2010 C'mon... the fourth post in this forum is entitled Recruiting AI Soldiers, how did you miss that and the "Search before posting" sticky? Share this post Link to post Share on other sites
horror1 10 Posted September 13, 2010 i did not miss it , i even posted in it but the thread was not exactly what im looking for and it dont even get any solution. it seems to be very difficult cause i couldnt find a single solution for it even though i searched for days. so i decided to post my specific problem in an seperate thread. perhaps yu can give me a working solution for it? Share this post Link to post Share on other sites
kylania 567 Posted September 13, 2010 You'd limit the recruitment with this: this addAction["recruit","recruit.sqf",[],1,false,true,"","(count units group player) <= 2"]; Change the 2 to whatever group size you want, 2 meaning you can get 2 units max. As for deleting them after you log off, you'd probably do something with onPlayerDisconnected, but I'm not familiar with how that works and can't test it at the moment. Share this post Link to post Share on other sites
Bon 12 Posted September 13, 2010 (edited) Take a look at how you can recruit units in my TFOR mission - I extracted this feature into a sample mission which can be downloaded here: http://forums.bistudio.com/showthread.php?t=107549 (I hope you own Operation Arrowhead, otherwise all you have to change is the file recruitable_units.sqf). It deletes dead recruit bodies after 2 minutes, kills recruited AI in case the player disconnects and deletes them afterward. You can access the dialog by calling the script "bon_recruit_units\open_dialog.sqf", as you do it via mouse action in the sample mission. Restricting this to be available only once per life is another story, where many different approaches exist... Edited September 15, 2010 by Bon Share this post Link to post Share on other sites
horror1 10 Posted September 14, 2010 thx alot for your help guys you both helped me alot. @bon your script is great it should be in the scripting faqs and you should release your script as download.:) Share this post Link to post Share on other sites