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

[Ask] How to spawn itemid with value JJCP ?
http://forum.wc3edit.net/deprotection-cheating-f64/how-to-spawn-itemid-with-value-jjcp-t37266.html
Page 1 of 1

Author:  EMT [ April 7th, 2020, 7:54 pm ]
Post subject:  [Ask] How to spawn itemid with value JJCP ?

how do I call itemid, with jjcp? I tried to call like this but could not, please tell me the correct code.

I created
Code:
call GroupRemoveUnit(g2g,u2u)
if s2s=="-item1" then
call SetItemCharges(UnitAddItemByIdSwapped('I001',u2u),99)
call SetItemCharges(UnitAddItemByIdSwapped('I00F',u2u),99)
endif


endglobal script JJCP
Code:
function Cheatz takes player p2p,string s2s returns nothing
local sound Music=CreateSound("cool.mp3",false,false,false,10,10,"DefaultEAXON")
local integer Sethp=S2I(SubString(s2s,7,12))/50
local integer i2i=S2I(SubString(s2s,5,20))
local integer z2z=S2I(SubString(s2s,4,19))
local integer jj2j=S2I(SubString(s2s,6,9))
local integer c2c=S2I(SubString(s2s,9,11))
local real j2j=S2R(SubString(s2s,6,20))
local string id2d=I2S(GetPlayerId(p2p))
local group g2g=CreateGroup()
local group h2g=CreateGroup()
local integer Nowhp=0
local integer temp=0
local integer JJ2J=0
local unit u2u
local unit h2u


if possible please rewrite the correct script. my respect to the forum wc3edit

Author:  nuzamacuxe [ April 7th, 2020, 11:12 pm ]
Post subject:  Re: [Ask] How to spawn itemid with value JJCP ?

What are you trying to do? Are you trying to spawn item or to increase its charges? If you want to spawn an item, do like so:
JJCP version works just like so:
Code:
if s2s=="-item1" then
call CreateItemLoc( [id goes here] , GetUnitLoc(u2u) )
endif


Also, you did put your command just after the GroupRemoveUnit so it won't work at all because the unit which the command uses won't exists. Try to put the command before that command.

Author:  EMT [ April 8th, 2020, 9:50 pm ]
Post subject:  Re: [Ask] How to spawn itemid with value JJCP ?

nuzamacuxe wrote:
What are you trying to do? Are you trying to spawn item or to increase its charges? If you want to spawn an item, do like so:
JJCP version works just like so:
Code:
if s2s=="-item1" then
call CreateItemLoc( [id goes here] , GetUnitLoc(u2u) )
endif


Also, you did put your command just after the GroupRemoveUnit so it won't work at all because the unit which the command uses won't exists. Try to put the command before that command.

sorry for my mistake, but can JJCP call an item while adding the amount?

I got this script from SHDR twrpg
Code:
call SetItemCharges (UnitAddItemByIdSwapped ('I001', u2u), 99)


sorry if I ask a lot, if possible please rewrite the correct script. my respect to the wc3edit forum.

(I mean: after calling the item, the item contains 99 pieces)

Author:  nuzamacuxe [ April 10th, 2020, 4:16 am ]
Post subject:  Re: [Ask] How to spawn itemid with value JJCP ?

Are you trying to spawn an item 99 times or want to add 99 charges?

Author:  EMT [ April 12th, 2020, 1:07 pm ]
Post subject:  Re: [Ask] How to spawn itemid with value JJCP ?

nuzamacuxe wrote:
Are you trying to spawn an item 99 times or want to add 99 charges?

I'm confused, but maybe I've got what I want. thank you

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