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

Linux Players can take items from boundary of house (e.g. items in door)

okurde

New Member
Joined
Jan 28, 2009
Messages
134
Reaction score
1
Hello,
is there any simple c++/lua script which prevent taking items by all players from edges of house? For exmaple from doors, walls etc, only owners should be available to do that.
Or any idea where I should search it in sources? house.cpp, tile.cpp, game.cpp, movement.cpp? I have TFS 0.3.7-0.4/OTserv.

Thanks in advance
 
I do not have acesa to source to take a look, but here is the summary.

Find the script that handles player move events and detect click. You will may have to do some couts to find the right event. Then, return of the spot is a house and player is not the owner.

I cannot think on a way this can be done using Lua.
 
in tfs 1.2, it is very easy by just using player events. In 0.x, it has to be done through source editing.
 
I guess that this script works like "if player want to move any special item then do not allow to perform it" -
if moveitem.itemid == 6500 then
doPlayerSendTextMessage(cid,25,'This item is blocked! you cannot move it!')

It is now what I am looking for. I want to prevent taking all the items from house by player who is not owner/invited.
Any simpler way? I think it can be done in 1-2 lines in sources - check if player is invited to house, if not then sendCancel(not_invited) + return false or sth like this, during movement item
 
local tilehouse = getHouseFromPos(fromPosition)
local phouse = getHouseByPlayerGUID(cid)
if tilehouse and phouse and tilehouse ~= phouse then
return false
else
return true
end
enough with the onmoveitem event, and its useful for other things also
 
Back
Top