wc3edit.net

United Warcraft 3 map hacking!
It is currently March 19th, 2024, 3:13 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: April 19th, 2020, 5:22 pm 
Offline
Newcomer
User avatar

Joined: September 9th, 2017, 9:35 pm
Posts: 5
How to change patrol button for move in command -tele? (JJ2197's cheat pack)


Top
 Profile  
 
PostPosted: April 19th, 2020, 6:30 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
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/


Top
 Profile  
 
PostPosted: April 19th, 2020, 7:07 pm 
Offline
Newcomer
User avatar

Joined: September 9th, 2017, 9:35 pm
Posts: 5
owner123, whoa finaly i found a solution, thx a lot bro


Top
 Profile  
 
PostPosted: April 20th, 2020, 4:13 am 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1791
Title: Just Another S.Mod
I already made a JJCP with that command.

post203994.html#p203994


Top
 Profile  
 
PostPosted: April 21st, 2020, 11:21 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
Huh, I was reading this over again and the JJCP tele command actually has a memory leak. There's a non-destroyed location. Also several lines of code that set objects to null or empty unnecessarily. Not only that, it also has a Wait which is considered harmful. You could trigger tele multiple times and allocate memory for the trigger/triggeraction unnecessarily. It also allocates a trigger for every player who uses -tele which is unnecessary. It's actually not very well programmed.


Top
 Profile  
 
PostPosted: April 21st, 2020, 11:57 pm 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1791
Title: Just Another S.Mod
All in all, old cheatpacks aren't very well programmed. xD


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)