【千年服务端】关于大地图PK死亡传送到另一地图
关于大地图PK死亡传送到另一地图 在中央常PK的地方放置一个NPC叫——中央管理员,建议放在500 500的位置。unit 中央管理员;
interface
functionGetToken (aStr, aToken, aSep : String) : String;
functionCompareStr (aStr1, aStr2 : String) : Boolean;
functioncallfunc (aText: string): string;
procedure print (aText: string);
functionRandom (aScope: integer): integer;
functionLength (aText: string): integer;
procedure Inc (aInt: integer);
procedure Dec (aInt: integer);
functionStrToInt (astr: string): integer;
functionIntToStr (aInt: integer): string;
procedure exit;
procedure OnChangeState (aStr : String);
implementation
//下面是当玩家状态改变时,也就是检测到玩家死亡了。
procedure OnChangeState (aStr : String);
var Str, Name : String;
begin if aStr <> 'die' then exit;
Str := callfunc ('getsenderrace');
//这里是检测死亡的是不是玩家
if Str <> '1' then exit;
//下面这一段和普通传送有点不同,这个是利用本地图的NPC传送的,如果本地图没有中央管理员,那么这段就无效了。
Name := callfunc ('getsendername');
Str := 'movespacebyname ' + Name;
Str := Str + ' user 6 84 81 中央管理员 npc 300';
print (Str);
end;
end.
页:
[1]