• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

C++ Delay drop items in house

douglasscherner

New Member
Joined
Aug 15, 2014
Messages
26
Reaction score
1
Hello guys. Some players are crashing my otserv puting dropitems gps and worms fast in ground of houses and moving fast.

I need help to change this function on events/scripts/player.lua

function Player:eek:nMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)

How I can get creature id from this to put exausted in specific player in house?
local player = Player(uid) dont work

Thanks a lot some help.
Post automatically merged:

I do it.
local player= self
 
Last edited:
OP
OP
douglasscherner

douglasscherner

New Member
Joined
Aug 15, 2014
Messages
26
Reaction score
1
Here is the code:
Lua:
local tile = Tile(toPosition)
    if self:getStorageValue(33018)+30000 > os.clock()*1000000 then
        return
    end
    self:setStorageValue(33018, os.clock()*1000000)

    local tile2 = Tile(toPosition)
    if tile2 then
        if tile2:hasFlag(TILESTATE_PROTECTIONZONE) then
            if self:getExhaustion(33015) > 0 then
            doPlayerSendCancel(self, "You are exausted in 1 second.")
                return
            end
            self:setExhaustion(33015, 1)
            if tile2:getHouse() then
                addEvent(function ()
                    self:save()
                end,100)
            end
        end
    end

    local tile3 = Tile(fromPosition)
    if tile3 then
        if tile3:hasFlag(TILESTATE_PROTECTIONZONE) then
            if self:getExhaustion(33016) > 0 then
            doPlayerSendCancel(self, "You are exausted in 1 second.")
                return
            end
            self:setExhaustion(33016, 1)
            if tile3:getHouse() then
                addEvent(function ()
                    self:save()
                end,100)
            end
        end
    end
Post automatically merged:

I need help to increment in my script the function //doSaveHouse for tfs 0.4/1.0
So when a player get itens in house or put there the player is saved and I need that the house be saved too.
Can someone help me?
 
Top