LucasFerraz
Systems Analyst
Doggynub, can you tell us which the best way to do this to all movements? (operational cost)
Lol, this is the creaturescript that uses the c++ code you just added to your server so yes it is creaturescript and you register it like i is shown in first page in one of the posts or like any other creaturescript!!
<event type="login" name="saveOn" event="script" value="save.lua"/>
I guess it would be too hard to just try out "move"
[COLOR=#666666][I]//custom move[/I][/COLOR]
[COLOR=#B1B100]else[/COLOR] [COLOR=#B1B100]if[/COLOR][COLOR=#009900]([/COLOR]tmpStr [COLOR=#339933]==[/COLOR] [COLOR=#FF0000]"move"[/COLOR][COLOR=#009900])[/COLOR] m_type [COLOR=#339933]=[/COLOR] CREATURE_EVENT_ONMOVE[COLOR=#339933];[/COLOR] [COLOR=#666666][I]//
game.cpp:1520: warning: suggest parentheses around '&&' within '||'
game.cpp:1520: warning: suggest parentheses around '&&' within '||'
status["inInvBag"] = (Out && !In && !checkToSlot )? 0In && !Out || !Out && equip && checkToSlot) ? 1In && Out || Out && equip && checkToSlot)?2:3;
--$$ Undropable Items $$--
local items = {2222} -- item ids that is undropable
--[[ Script]]--
function searchContainers(uid,itemss)
local items = itemss
local containers = {}
local check = false
for i = 0, getContainerSize(uid)-1 do
local item = getContainerItem(uid,i)
if not isContainer(item.uid) then
if isInArray(items,item.itemid) then
check = true
end
else
table.insert(containers,item.uid)
end
end
for _, container in ipairs(containers) do
if searchContainers(container,items) then
check = true
break
end
end
return check
end
function onMoveItem(cid, item, formPosition, toPosition, fromItem, toItem, fromGround, toGround, status)
if status.inInv == 1 and status.inInvBag == 3 and status.inDepot == 3 and isInArray(items,getPlayerSlotItem(cid,status.slot).itemid ) then
doPlayerSendCancel(cid,"You can't drop a special item on the ground.")
doSendMagicEffect(getThingPos(cid),2)
return false
end
if (status.inInv == 0 and status.inInvBag == 3 and status.inDepot == 3) or
(status.inDepot == 0 and status.inInv == 3 and status.inInvBag == 3 ) or
(status.inInvBag == 0 and status.inDepot == 3 and status.inInv == 3) then
if not isContainer(item.uid) then
if isInArray(items,item.itemid) then
doPlayerSendCancel(cid,"You can't drop a special item on the ground.")
doSendMagicEffect(getThingPos(cid),2)
return false
end
else
if searchContainers(item.uid,items) then
doPlayerSendCancel(cid,"You can't throw this bag that contains special item[s] on ground")
doSendMagicEffect(getThingPos(cid),2)
return false
end
end
end
return true
end
function onMoveItem(cid, item, formPosition, toPosition, fromItem, toItem, fromGround, toGround, status)
if (getTileInfo(fromPosition).house) then
--doSaveHouse({getHouseByPlayerGUID(getPlayerGUID(cid))}) It will save the house of player who is moving item no matter if he is inside of his house of anyone else
--doSaveHouse({getTileInfo(fromPosition).house)}) Will it work??
--doSaveHouse({getHouseByPlayerGUID(getTileInfo(fromPosition).house)}) Will it work??
end
return true
end
Bug =x , i use 0.3.6pl1
Bug in token '}'
How can I save this house?
Player who is moving item can or not be owner of this house.
Lua:function onMoveItem(cid, item, formPosition, toPosition, fromItem, toItem, fromGround, toGround, status) if (getTileInfo(fromPosition).house) then --doSaveHouse({getHouseByPlayerGUID(getPlayerGUID(cid))}) It will save the house of player who is moving item no matter if he is inside of his house of anyone else --doSaveHouse({getTileInfo(fromPosition).house)}) Will it work?? --doSaveHouse({getHouseByPlayerGUID(getTileInfo(fromPosition).house)}) Will it work?? end return true end