cccbss 发表于 2013-4-12 17:50
对了,ai死后刷新一个新的怎么实现?
?!(isServer):exit;
createcenter east;
createcenter west;
west setfriend [east,0];
east setfriend [west,0];
_ap=_this select 0;
_ep=_this select 1;
_index=0;
?_ap==player:_index=1;
_side=side _ap;
_pos=getpos _ep;
_type=(typeof _ap);
_group=group _ap;
_skill=skill _ap;
_rank=rank _ap ;
#loop
? not(alive cmd):exit;
@not(alive _ap);
[_ap]exec"hidebody.sqs";
_type createunit[_pos,_group,"RES=this",_skill,_rank];
_ap=RES;
_ap addweapon"";
RES=objnull;
?_index==1:addswitchableunit _ap ;
_ap setpos _pos;
_group addWaypoint [ markerPos "attackpoint", 100];
[_group, 1] setWaypointType "DESTROY";
[_group, 1] setWPPos markerPos "attackpoint";
[_group, 1] setWaypointSpeed "FULL";
[_group, 1] setWaypointFormation "LINE";
[_group, 1] setWaypointBehaviour "safe";
[_group, 1] setWaypointCombatMode "RED";
goto"loop"
//[this,重生地点名字] exec "res.sqs" 地图上要设定一个叫cmd的单位,他死了脚本就终止执行就不刷兵了
//{[_x,重生地点名字] exec "res.sqs"} foreach units group this 整组使用重生脚本
//也可以用距离来定义不刷新的条件 ?(player distance _ep <= 150):exit;
试着理解一下。。。这个也可以用来做单兵复活。。。不是我写的。。 |