Jass/GUI How do i make it so players cant move items in there inv.

Level 10
Joined
Jul 11, 2010
Messages
422
Here's a trigger in jass that do that :

JASS:
function Trig_CatchInvOrder_Conditions takes nothing returns boolean
    return GetIssuedOrderId()>=852002 and GetIssuedOrderId()<=852007
endfunction

function Trig_CatchInvOrder_Actions takes nothing returns nothing
    call PauseUnit(GetTriggerUnit(),true)
    call IssueImmediateOrderById(GetTriggerUnit(),851973)
    call PauseUnit(GetTriggerUnit(),false)
endfunction

//===========================================================================
function InitTrig_CatchInvOrder takes nothing returns nothing
    set gg_trg_CatchInvOrder = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_CatchInvOrder, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerAddCondition( gg_trg_CatchInvOrder, Condition( function Trig_CatchInvOrder_Conditions ) )
    call TriggerAddAction( gg_trg_CatchInvOrder, function Trig_CatchInvOrder_Actions )
endfunction

You have to create a trigger called "CatchInvOrder", convert it into custom script and paste the code inside :wink:.

EDIT : You also have to disable this trigger when you use the action "Order unit to move item to inventory slot". Just disable before the action and enable just after.
 
Level 17
Joined
Jan 21, 2006
Messages
2,545
The order IDs 852002 to 852007 are for inventory movement orders. If you select an item and try to move it to a slot, you will be able to determine which slot the item was moved to by subtracting by 852002 from the order ID.

In order to reference the item that was "ordered" to another inventory position you can simply use GetOrderTargetItem( ).
 
Level 5
Joined
May 8, 2010
Messages
150
Sorry, i don't know Jass.
But i've made a trigger with the name "CatchInvOrder" .. copied the code and this is the problem with code apparently.. "function Trig_CatchInvOrder_Conditions takes nothing returns boolean"
so it disables the trigger.
Heeelp?
 
Level 4
Joined
May 20, 2008
Messages
89
[trigger=My Trigger]Disable item drops for Hero
Events
Conditions
Actions
For each integer (Integer A) 1 to 6 do Actions:
Item - Make (Item carried by Hero in inventory slot (For loop Integer A)) undroppable.[/trigger]

+rep me if i helped :thumbs_up:
 
Level 16
Joined
Oct 10, 2009
Messages
1,425
Skore_sM
Never ask for rep.
It's actually against the rules.

@ pRo.MAPMAKER
Anyways(if I understand your problem), you're using the custom script function, in GUI. which you shouldn't be doing.

Go to the trigger and do, Edit->Convert to custom text.->then remove everything in the box that will pop up where your trigger once was -> then copy the code he gave you.
 
Top