This is the code responsible for tele
Code:
function Tele2 takes nothing returns nothing
local unit u2u=GetTriggerUnit()
local location k2k=GetOrderPointLoc()
if GetIssuedOrderId()==851990then
call SetUnitPosition(u2u,GetLocationX(k2k),GetLocationY(k2k))
endif
set u2u=null
set k2k=null
endfunction
function Tele takes player p2p,string s2s returns nothing
local trigger t2t=CreateTrigger()
local triggeraction zta=TriggerAddAction(t2t,function Tele2)
call TriggerRegisterPlayerUnitEvent(t2t,p2p,ConvertPlayerUnitEvent(39),null)
call WaitForString(p2p,s2s,false)
call DisableTrigger(t2t)
call TriggerRemoveAction(t2t,zta)
call DestroyTrigger(t2t)
set t2t=null
set zta=null
set p2p=null
set s2s=""
endfunction
Code:
elseif SubString(s2s,0,5)=="-tele"then
call Tele(p2p,"-note")
When you type -tele it dynamically makes a Trigger linked to action Tele2 for that player.
This line checks the order ID:
Code:
if GetIssuedOrderId()==851990then
851990 is the order for Patrol, so you'd need to change it there.
List of order ids:
https://www.thehelper.net/threads/order-ids.148097/