i want add a item bound system that
binds item when a player type -save
binds item when a player types load on his load character
my current look like this
can someone change it?
binds item when a player type -save
binds item when a player types load on his load character
my current look like this
- //TESH.scrollpos=1
- //TESH.alwaysfold=0
- library ItemBinding initializer init
- private function pickupItem takes nothing returns nothing
- local item i = GetManipulatedItem()
- local unit u = GetTriggerUnit()
- // check if item is bound
- if GetItemUserData(i) == 0 then
- // not bound, bind it
- call SetItemUserData(i, GetPlayerId(GetOwningPlayer(u))+1)
- else
- // bound
- if GetItemUserData(i) != GetPlayerId(GetOwningPlayer(u))+1 then
- call UnitDropItemPoint(u, i, GetUnitX(u), GetUnitY(u))
- call DisplayTextToPlayer(GetOwningPlayer(u), 0., 0., "This item is bound")
- endif
- endif
- endfunction
- private function init takes nothing returns nothing
- set gg_trg_Item_Binding = CreateTrigger( )
- call TriggerRegisterAnyUnitEventBJ(gg_trg_Item_Binding, EVENT_PLAYER_UNIT_PICKUP_ITEM)
- call TriggerAddAction(gg_trg_Item_Binding, function pickupItem)
- endfunction
- endlibrary
can someone change it?