• 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!

TFS 1.X+ [1.4.2] Block Item On Map.

OTcreator

Active Member
Joined
Feb 14, 2022
Messages
425
Solutions
1
Reaction score
44
Hello!
When i put nothing special in rme can move items.
When i add action ID in rme can move items.
How i can block items on map on tfs 1.4.2?
 
Lua:
local ec = EventCallback

ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
    if item:getActionId() == 2600 then
        return RETURNVALUE_NOTPOSSIBLE
    end
end

ec:register()

local ec2 = EventCallback

ec2.onTradeRequest = function(self, target, item)
    if item:getActionId() == 2600 then
        return RETURNVALUE_NOTPOSSIBLE
    end
end

ec2:register()

Are you 100% sure the item you are moving has the action id of 2600?
 
Last edited:
Try putting it directly in the player event file.

Search for player: onMoveItem in events/scripts/player.lua

Just add:
Lua:
if item:getActionId() == 2600 then
    return RETURNVALUE_NOTPOSSIBLE
end
 
Try putting it directly in the player event file.

Search for player: onMoveItem in events/scripts/player.lua

Just add:
Lua:
if item:getActionId() == 2600 then
    return RETURNVALUE_NOTPOSSIBLE
end

This is work!!! On eventcallback not working, on events/player.lua working good!
Now give me onTradeRequest please :)

Possible to create script who block stand on itemID?
 
This is work!!! On eventcallback not working, on events/player.lua working good!
Now give me onTradeRequest please :)

Possible to create script who block stand on itemID?
Just put the same code within the Player: onTradeRequest function, in the same file

Make sure onTradeRequest is enabled in events.xml
 
Try putting it directly in the player event file.

Search for player: onMoveItem in events/scripts/player.lua

Just add:
Lua:
if item:getActionId() == 2600 then
    return RETURNVALUE_NOTPOSSIBLE
end

You once helped me solve this problem and so far this solution has suited me.
Only if I get some blocked item in my hand or in the shot slot I can no longer pull it out in any way.
Is it possible to do something so that an item e.g. bought in the shop does not fall into the arrow slot/hand, but into the BP?
 
You once helped me solve this problem and so far this solution has suited me.
Only if I get some blocked item in my hand or in the shot slot I can no longer pull it out in any way.
Is it possible to do something so that an item e.g. bought in the shop does not fall into the arrow slot/hand, but into the BP?

You will need to edit the NPC libs, more specifically the buy callback.
C++:
// player:addItem(itemId[, count = 1[, canDropOnMap = true[, subType = 1[, slot = CONST_SLOT_WHEREEVER]]]])
// player:addItemEx(item[, canDropOnMap = false[, index = INDEX_WHEREEVER[, flags = 0]]])
// player:addItemEx(item[, canDropOnMap = true[, slot = CONST_SLOT_WHEREEVER]])
You can specify the slot and/or index as an additional parameter to addItem/addItemEx
 
Back
Top