wc3edit.net
https://forum.wc3edit.net/

[ask]how to make a simple CP
http://forum.wc3edit.net/deprotection-cheating-f64/how-to-make-a-simple-cp-t37283.html
Page 1 of 1

Author:  EMT [ April 12th, 2020, 1:52 pm ]
Post subject:  [ask]how to make a simple CP

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

Author:  owner123 [ April 12th, 2020, 8:13 pm ]
Post subject:  Re: [ask]how to make a simple CP

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/