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

Is it possible to prevent put items on any tile?

ligus

New Member
Joined
Apr 26, 2010
Messages
253
Reaction score
0
Hello, I want to prevent put items on teleport, is it possible?
I have this Item Editor:
tp.png


Does anyone have any idea what should be selected?
 
I'm unsure about the actual item.. But you could make a script that if anything buy a player steps on the teleport it will be teleport 1/2sqm away. just a thought.
 
Code:
function onStepIn(cid, item, pos, from)
    if isPlayer(cid) then
        return true
    end
    return false
end
 
With TFS 1.0+ you have a player.lua file inside events, inside that file you have a function called:
Code:
function Player:onMoveItem(item, count, fromPosition, toPosition)
Inside this function, you can apply a check by getting the tile type from "toPosition" and see if its a teleport or not.
From there on you can send a message saying you can't move it to a teleporter or whatever you like.
 
Unfortunately I don't use TFS 1.0 :(
Does anyone have any idea how it can be solved in TFS 0.3.7 [0.4]?

movements.xml
Code:
<movevent type="AddItem" tileitem="1" itemid="1387" event="script" value="no_add.lua"/>

no_add.lua
Code:
function onAddItem(moveitem, tileitem, position, cid)
        doRemoveItem(moveitem.uid) -- Removes the item
        doPlayerAddItem(cid, moveitem.itemid, moveitem.type) -- Returns the item back to the sender
        doPlayerSendCancel(cid, "You may not throw items here.") -- Sends cancel message
    return true
end
 
Back
Top