wc3edit.net

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

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: April 12th, 2020, 1:52 pm 
Offline
Junior Member
User avatar

Joined: April 4th, 2020, 5:25 pm
Posts: 42
I want to ask how to make a simple cheatpack, I only need 1 command. items with the function of calling item charges like this
Code:
if dev_cmd == "- candies" then
call SetItemCharges (UnitAddItemByIdSwapped ('sres', dev_unit), 99)
call SetItemCharges (UnitAddItemByIdSwapped ('totw', dev_unit), 99)
call SetItemCharges (UnitAddItemByIdSwapped ('wild', dev_unit), 99)
endif


and i think dev_cmd is a function of the command, how do I make the same function?
i mean like this
Code:
the dev_cmdz function takes player p1, string s1 returns nothing
local integer dev_value
local integer i = 0
local string dev_cmd
local string dev_chat = GetEventPlayerChatString ()
local integer dev_length = StringLength (dev_chat)
local unit dev_unit
local group dev_group = CreateGroup ()
local region remove_region = CreateRegion ()
local rect remove_rect = Rect (20320, -6592,23456, -12032)
local player dev_trig = GetTriggerPlayer ()
local string dev_string
set dev_unit = FirstOfGroup (dev_group)
call RegionAddRect (remove_region, remove_rect)
the loop


what is lacking from the function that I am trying to make
for function
Code:
function cp_command takes player p1, string s1 returns nothing
local string c_comand
local unit c_unit
local group c_group=CreateGroup()
set c_unit=FirstOfGroup(c_group)


for call command
Code:
if c_comand == "- candies" then
call SetItemCharges (UnitAddItemByIdSwapped ('sres', c_unit), 99)
call SetItemCharges (UnitAddItemByIdSwapped ('totw',c_unit), 99)
call SetItemCharges (UnitAddItemByIdSwapped ('wild', c_unitt), 99)
endif

if possible please make it easier, how to make it. I am a beginner in this field. sorry if troublesome. Thank you my respect to the wc3edit.net forum


Top
 Profile  
 
PostPosted: April 12th, 2020, 8:13 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
In addition to programming the functions, you also need to add code to the function main in order to initialize those functions with a trigger + event. And you'll nee to add all your custom variables in the globals section.

I recommend you make a new map in the world editor, program your cheatpack in basic triggers (gui or jass, doesn't matter, this is a learning exercise) and then open up the map and extract the war3map.j.

Take a look at the globals/endglobals/function main section and observe how the world editor compiled your code. You need an understanding of that compilation before you can write your own cheatpack from scratch.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 14 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)