ИМХО проще всего сделать тп по команде из чата, а чтобы не тормозить в бою, забить ее в макрос.
Например так
По команде "/UTP TP" должен произойти телепорт.
Код:
// UrgentTP v.1.0. (c) broveymimo
// Запуск SendPMessage("UTP","INI")
var le,inil,portl,namel,PID,itemID:integer;
ini,port,name:string;
flag,init:boolean;
procedure OnCreate;
begin
le:=23;
ini:='INI';
inil:=length(ini);
port:='TP';
portl:=length(port);
name:='UTP';
namel:=length(name);
flag:=false;
init:=false;
end;
Procedure MsgInfo(msg : string);
begin
gSys.EnSendC(FormatPck('%hcdacha',[$0A02,02,0,'[!]'+FStr(16),Length(msg) + 2,$203A,msg+#0]));
gsys.sleep(15);
end;
BEGIN
if length(_gBuff) < 4 then exit;
PID:= GInt(_gBuff,3,2);
if not (_gFromServ) then
case PID of
$0302: begin
if strcmp(copy(_gBuff,5,namel),name) then
begin
if strcmp(copy(_gBuff,le,inil),ini) then
begin
flag:=true;
MsgInfo('UrgentTP запущен');
MsgInfo('используйте ТП из инвентаря');
MsgInfo('для инициализации');
end;
if strcmp(copy(_gBuff,le,portl),port) and init then gSys.SendS(FormatPck('%hcc',[$1A04,itemID,0]));
gBlockPacket;
end;
end;
$1A04: if flag then
begin
itemID:= GInt(_gBuff,5,1);
flag:= false;
init:= true;
gBlockPacket;
MsgInfo('ТП инициализирован успешно');
end;
$160D: if (GInt(_gBuff,5,1) = 7) and init then gSys.SendS(FormatPck('%hcc',[$1A04,itemID,0]));
end;
if _gFromServ then
case PID of
$660D: begin
MsgInfo('Welcome to UrgentTP v.1.0');
MsgInfo('скрипт (c) broveymimo, 2010');
MsgInfo('');
MsgInfo('/UTP INI для запуска скрипта');
MsgInfo('после запуска используйте ТП');
MsgInfo('из инвентаря для инициализации');
end;
end;
END.