Hello there, im here again whit more stuid qestions :o ;D ;D
Im making now a mission that you are a Skilled Sniper, and you must kill (like allwyse ¨:P) a important russian man... but when you where inserted by UH-60 everybody dies execept you. you must find a radio for contacting alieds and leave the island.. and optional, kill the russian, and on the island, there is a lott of Russian patrols everywhere. I thought a good way to add action to the mission, is a script wich detects the distance from the player of every grup leader, and if it is under 150m, do something, (like dotarget player, domove getpos player setcombatmode "red", etc)
this is the idea... but it dont work at all (its only for infantry, the tanks shoul'nt exec this script)
Exequed by:
[leader this] exec "ceek.sqs" on any member of every group
(Now edited)
#loop
_l = _this select 0
? _l distance player <150 or ? _l knowsabout player > 0.2 : goto "destroy"
? isnull _l : exit
~2
goto "loop"
#destroy
? isnull _l : exit
{_x dotarget player} foreach units group _l
group _l setcombatmode "red"
;// in case there are on any cargo of a URAL/UAZ
{unassignvehicle _x} foreach units _l
_l domove getpos player
? _l distance player < 20 : _l domove getpos _l
? ! alive player : goto "exit"
? isnull _l : exit
~1
goto "destroy"
#exit
_l setbehavior "aware"
exit
EDIT
[/b]
Ok, I still needing help whit this...
Why it dosnt works? because it dont change anyting, I tried putting a group of 4 russian in a UAZ, and me as a sniper a few blocks away, and I put a trigger that the UAZ come to me and go a few blocks away of me... when it is closer, i shot, (not to the UAZ, but near) and everyvody gets out and start shoting me, but the leader keeps on the UAZ.. and goes to the waypoint...
I have experienced the same thing Whitout exequing the script..... so in fact it dosnt work
NoteI'll be exequing the script via [Leader this] because I dont alwise exec the script on the Leader's Init field, It must end when the leader is dead... so it appears that the leader is the only who konws what the hell is happenging, when the others are just rokie loons...