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

Windows RME Map editor, how to make item unmovable?

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,684
Solutions
127
Reaction score
2,130
How to make item not movable?

I have many items on my new island so i need to make it unmovable, because people will steal XD
I dont want to put uniqueid on every item.
 
yes, there is onTradeRequest event, that you can use to prevent trading an item

btw hello me from the past, how you been? XD
Hello thank for point me out where i should look
i did the same thing as peonso said ontraderequest, does not work, have it enabled in events.xml
Edit was enabling wron event this solved my issue
Lua:
--function Player:onTradeRequest(target, item)
--    if hasEventCallback(EVENT_CALLBACK_ONTRADEREQUEST) then
--        return EventCallback(EVENT_CALLBACK_ONTRADEREQUEST, self, target, item)
--    end
--    return true
--end
function Player:onTradeRequest(target, item)--function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder) --agregado bloqueo de items con aid 9552
   if item.actionid == 9502 then
     self:sendCancelMessage('You cannot trade this object.')
     return false
   end
   return true
end
Post automatically merged:

How about blocking a square area with isInRange?
Lua:
local protectedArea = {
    from = Position(3197, 1807, 7),
    to = Position(3198, 1811, 7)
}

local ec = EventCallback

function ec.onMoveItem(player, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
    if fromPosition.x == CONTAINER_POSITION then
        fromPosition = item:getTopParent():getPosition()
    end

    if fromPosition:isInRange(protectedArea.from, protectedArea.to) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "iwi")
        return false
    end
    return true
end

ec:register(-666)
would it prevent items from being trade? @Sarah Wesker edited.
 
Last edited:
Hello thank for point me out where i should look
i did the same thing as peonso said ontraderequest, does not work, have it enabled in events.xml
Edit was enabling wron event this solved my issue
Lua:
--function Player:onTradeRequest(target, item)
--    if hasEventCallback(EVENT_CALLBACK_ONTRADEREQUEST) then
--        return EventCallback(EVENT_CALLBACK_ONTRADEREQUEST, self, target, item)
--    end
--    return true
--end
function Player:onTradeRequest(target, item)--function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder) --agregado bloqueo de items con aid 9552
   if item.actionid == 9502 then
     self:sendCancelMessage('You cannot trade this object.')
     return false
   end
   return true
end
Post automatically merged:


would it prevent items from being trade? @Sarah Wesker edited.
check the publication again and you will find the solution for the Trades
 
Back
Top