• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
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.
 
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( ).
 
[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:
 
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.
 
Status
Not open for further replies.
Back
Top