• 🏆 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] Item bug

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
I have this trigger that been made so poepel wdont use mroe than 1 ticket(item)!!!

bug: evrytime that i dropped the ticket or give to some1 else , i cant take a new ticket or old ticket!! so the result make that im stuck in heaven (ticket used 2 revive) maybe some1 could saw whats wrong i tryed some thing and none worked :/ im not very familiar with jass


JASS:
function Trig_One_Ticket_Only_Func003C takes nothing returns boolean
	return((GetOwningPlayer(GetManipulatingUnit())==Player(0)))or((GetOwningPlayer(GetManipulatingUnit())==Player(1)))or((GetOwningPlayer(GetManipulatingUnit())==Player(2)))or((GetOwningPlayer(GetManipulatingUnit())==Player(3)))or((GetOwningPlayer(GetManipulatingUnit())==Player(5)))or((GetOwningPlayer(GetManipulatingUnit())==Player(6)))
endfunction

function Trig_One_Ticket_Only_Conditions takes nothing returns boolean
	return((GetItemTypeId(GetManipulatedItem())=='I01X'))and(Trig_One_Ticket_Only_Func003C())
endfunction

function Trig_One_Ticket_Only_Func001C takes nothing returns boolean
	return((GetUnitUserData(GetManipulatingUnit())==1))
endfunction

function Trig_One_Ticket_Only_Actions takes nothing returns nothing
	if(Trig_One_Ticket_Only_Func001C())then
                call DestroyEffectBJ( GetLastCreatedEffectBJ() )
                call TriggerSleepAction(1.00)
		call UnitRemoveItemSwapped(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01X'),GetManipulatingUnit())
	else
                call DestroyEffectBJ( GetLastCreatedEffectBJ() )
                call TriggerSleepAction(1.00)
		call SetUnitUserData(GetManipulatingUnit(),1)
	endif
endfunction
 
Last edited:
Status
Not open for further replies.
Top