• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] help plz!!!

Status
Not open for further replies.
Level 1
Joined
Jul 12, 2004
Messages
4
i am using a predone bagsystem and want to modify it but when i tired i crashed the trigger
reason i want to midify it is becuase i have a 1 weapon/armor/amulet rule per hero and want to restrict what can be put into a bag
Code:
function Trig_pick_one_up_Actions takes nothing returns nothing
   local string s=GetHerostr(GetManipulatingUnit())
   local integer it=bp()
   local integer slot=GetSlot(GetManipulatingUnit(),GetManipulatedItem())
   local string bps=GetBPStr(GetManipulatedItem())
   if(GetItemTypeId(GetManipulatedItem())==it)then
     call SetItemInvulnerableBJ( GetManipulatedItem(), true )
     if(GetState(s)==0 and GetBps(s)=="")then
      if(bps!="")then
        call SetBps(s,bps)
      else
        set bps=CreateBPStr(GetManipulatedItem())
        call SetBps(s,bps)
      endif
        call SetPos(s,slot)
     elseif(s!="" and GetBps(s)!="" and GetState(s)==0)then
        call UnitRemoveItem(GetManipulatingUnit(),GetManipulatedItem())
        call SimError( GetOwningPlayer( GetManipulatingUnit() ), "You can't hold two backpacks!")
     elseif(s=="" and IsUnitType(GetManipulatingUnit(), UNIT_TYPE_HERO) and not( IsUnitHidden(GetManipulatingUnit() )))then
        call CreateHerostr(GetManipulatingUnit())
     endif
   endif       
endfunction

//===========================================================================
function InitTrig_pick_one_up takes nothing returns nothing
    set gg_trg_pick_one_up = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_pick_one_up, EVENT_PLAYER_UNIT_PICKUP_ITEM )
    call TriggerAddAction( gg_trg_pick_one_up, function Trig_pick_one_up_Actions )
endfunction
i am pretty new to jass but not to java or basic any help would be apreciated
 
Status
Not open for further replies.
Top