• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

item fromPosition - slot? TFS 1.X

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,838
Solutions
18
Reaction score
616
Location
Poland
Hello there
Just quick question - is any possibility to declare from where you move item?
I mean i need function working like this:
If player move item from slots (head, armor, backpack, ammo, ring, etc.) then
something happen

It's there this function in TFS 1.X ?

I need this function to block one thing in script.

Thanks in advance,
F.

from slots to DIRECTLY to backpack
 
Last edited by a moderator:
Greetings,

You may be able to achieve that by taking advantage of fromCylinder & toCylinder (Arguments available for the Player event onMoveItem).
 
you compare fromPosition.x to CONTAINER_POSITION (macro for 65535)
check fromPosition.y for the slot value in the inventory, if it's <= 11 (CONST_SLOT_AMMO) then the item comes from the inventory (make sure it's also not equal to CONST_SLOT_BACKPACK)
then do the same for toPosition, but for toPosition.y you check if it is CONST_SLOT_BACKPACK, if it is then you cancel or do whatever you want
 
Back
Top