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

[TFS 1.1] check player eq/dp

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,323
Solutions
26
Reaction score
2,690
Location
Poland
functions to see online players eq/depot
reversing parameters will result giving a copy of your eq/depot to specified player

spyEq:
cid will receive a copy of target's eq and bp content
target will not lose anything and won't be notified

example: spyEq(cid, "your target")
you will receive a blue backpack with a perfect copy of your target's eq
he won't even know about that nor lose anything

spyDepot:
you will receive a container with a perfect copy of target's depot from specified town
he won't even know about that nor lose anything

example: spyDepot(cid, "your target", 4)
"your target" field allows these types of data:
Code:
"name",
player,
cid (player:getId())

Functions:
Code:
function spyEq(cid, target)
   if not Player(cid) then
     return false
   end
  
   if not Player(target) then
     return false
   end
  
   local tr = Player(target)
   local main_bp = Container(doCreateItemEx(2002))
   for i = 1, 10 do
   local eq_slot = tr:getSlotItem(i)
   if eq_slot then
    main_bp:addItemEx(eq_slot:clone())
   end
   end
   Player(cid):addItemEx(main_bp)
   return true
end

function spyDepot(cid, target, town)
   if not Player(cid) then
     return false
   end
  
   if not Player(target) then
     return false
   end
  
   local tr = Player(target)
   local main_bp = Container(doCreateItemEx(17432))
   for i = 0, tr:getDepotChest(town, true):getItemHoldingCount() - 1 do
     if tr:getDepotChest(town, true):getItem(i) == nil then
       break
     end
     main_bp:addItemEx(tr:getDepotChest(town, true):getItem(i):clone())
   end
   Player(cid):addItemEx(main_bp)
   return true
end

Usage/installation:
it's up to you. I was too lazy to do action/talkaction so I used it via /execute
handle with care, if you reverse cid and target order, your target will receive a copy of your items
 
Last edited:
that is nice, what about doing a command to clone entire player status as well? something that would give you his lvl, vocation, skills, equip, and depot items, only house and guild would be left uncopied :D
 
other data is easy to get using functions
only items were hard to browse
I thought about doing mailbox as well but it's too much work.
 
This is brilliant! To clone the items so you still can catch the player in a lie :D

Great work, Thanks for the contribution!
 
@zbizu
First, thanks for this work!
Im trying to create a script using this functions in tfs 1.2, but no sucess.

Code:
function spyEq(cid, target)
  if not Player(cid) then
  return false
  end
 
  if not Player(target) then
  return false
  end
 
  local tr = Player(target)
  local main_bp = Container(doCreateItemEx(2002))
  for i = 1, 10 do
  local eq_slot = tr:getSlotItem(i)
  if eq_slot then
  main_bp:addItemEx(eq_slot:clone())
  end
  end
  Player(cid):addItemEx(main_bp)
  return true
end

function onSay(player, words, param)
  if not player:getGroup():getAccess() then
     return true
   end

   local target = Player(param)
   if target == nil then
     player:sendCancelMessage("A player with that name is not online.")
     return false
   end

   player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received a copy of " .. target:getName() .. " items.")
   spyEq(cid, target)
   print("Spy command has been used.")
   return false
end
Im wrong in create this script or this function is not compatible with tfs 1.2? thank you!
 
@zbizu
First, thanks for this work!
Im trying to create a script using this functions in tfs 1.2, but no sucess.

Code:
function spyEq(cid, target)
  if not Player(cid) then
  return false
  end
 
  if not Player(target) then
  return false
  end
 
  local tr = Player(target)
  local main_bp = Container(doCreateItemEx(2002))
  for i = 1, 10 do
  local eq_slot = tr:getSlotItem(i)
  if eq_slot then
  main_bp:addItemEx(eq_slot:clone())
  end
  end
  Player(cid):addItemEx(main_bp)
  return true
end

function onSay(player, words, param)
  if not player:getGroup():getAccess() then
     return true
   end

   local target = Player(param)
   if target == nil then
     player:sendCancelMessage("A player with that name is not online.")
     return false
   end

   player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received a copy of " .. target:getName() .. " items.")
   spyEq(cid, target)
   print("Spy command has been used.")
   return false
end
Im wrong in create this script or this function is not compatible with tfs 1.2? thank you!
 
Back
Top