- Joined
- Nov 8, 2007
- Messages
- 19
hi,
i ve written a function that should stor an integer value of an item in gamecache, but only if the value "place" is = 00 (free)
i start the function when a unit gets an item.
i have to say that im very nooby in jass, and i cant find the mistake!!
here the function:
InitInv_maxsize() is a constant that returns an integer value (64)
there are no syntax errors!
i hope somebody can help me pls!!!
i ve written a function that should stor an integer value of an item in gamecache, but only if the value "place" is = 00 (free)
i start the function when a unit gets an item.
i have to say that im very nooby in jass, and i cant find the mistake!!
here the function:
JASS:
function GetItem takes item it, unit u returns nothing
local integer id = GetItemTypeId(it)
local integer playerid = H2I(GetOwningPlayer(u))
local integer i = 0
local boolean slotfree = false
loop
exitwhen i == InitInv_maxsize()
if(GetStoredInteger(GC(), I2S(playerid + i), "SlotItem") == 0 ) then
call StoreInteger(GC(), I2S(playerid + i ), "SlotItem", id )
set slotfree = true
endif
set i = i + 1
endloop
if(slotfree == false) then
call DisplayTextToForce(GetForceOfPlayer(GetOwningPlaye
r(u)), "|cffCC0000 You have no free Inventory Slot!! |r" )
call CreateItemLoc(id, GetUnitLoc(u) )
endif
endfunction
InitInv_maxsize() is a constant that returns an integer value (64)
there are no syntax errors!
i hope somebody can help me pls!!!
Last edited by a moderator: