[Ask] How to spawn itemid with value JJCP ?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Post Reply
User avatar
EMT
Junior Member
Posts: 38
Joined: April 4th, 2020, 5:25 pm

[Ask] How to spawn itemid with value JJCP ?

Post by EMT »

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: Select all

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: Select all

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
You do not have the required permissions to view the files attached to this post.
User avatar
nuzamacuxe
Also Not an Admin, but closer than devoltz
Posts: 1655
Joined: February 14th, 2018, 5:35 am
Title: Just Another S.Mod

Re: [Ask] How to spawn itemid with value JJCP ?

Post by nuzamacuxe »

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: Select all

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.
User avatar
EMT
Junior Member
Posts: 38
Joined: April 4th, 2020, 5:25 pm

Re: [Ask] How to spawn itemid with value JJCP ?

Post by EMT »

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: Select all

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: Select all

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)
User avatar
nuzamacuxe
Also Not an Admin, but closer than devoltz
Posts: 1655
Joined: February 14th, 2018, 5:35 am
Title: Just Another S.Mod

Re: [Ask] How to spawn itemid with value JJCP ?

Post by nuzamacuxe »

Are you trying to spawn an item 99 times or want to add 99 charges?
User avatar
EMT
Junior Member
Posts: 38
Joined: April 4th, 2020, 5:25 pm

Re: [Ask] How to spawn itemid with value JJCP ?

Post by EMT »

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
Post Reply