• 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 0.4 Command Spy by Gods

adric21

Well-Known Member
Joined
Apr 26, 2016
Messages
275
Solutions
1
Reaction score
71
Talkactionxml:
Code:
<talkaction log="yes" access="3" words="!equipment" event="script" value="------.lua"/>

and later add this in your data/talkactions/scripts:
Code:
-- Equipment spy by Adric/underwar --
function getItemsInContainer(cont, sep)
local text = ""
local tsep = ""
local count = ""
for i=1, sep do
tsep = tsep.."-"
end
tsep = tsep..">"
for i=0, getContainerSize(cont.uid)-1 do
local item = getContainerItem(cont.uid, i)
if isContainer(item.uid) == FALSE then
if item.type > 0 then
count = "("..item.type.."x)"
else
count = "("..item.type+(1)..")"
end
text = text.."\n"..tsep..getItemNameById(item.itemid).." "..count
else
if getContainerSize(item.uid) > 0 then
text = text.."\n"..tsep..getItemNameById(item.itemid)
text = text..getItemsInContainer(item, sep+1)
else
text = text.."\n"..tsep..getItemNameById(item.itemid)
end
end
end
return text
end

function onSay(cid, words, param, channel)
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return TRUE
end
local slotName = {"Head Slot", "Amulet Slot", "Backpack Slot", "Armor Slot", "Right Hand", "Left Hand", "Legs Slot", "Feet Slot", "Ring Slot", "Ammo Slot"}
local player = getPlayerByNameWildcard(param)
if isPlayer(player) == TRUE then
local text = getPlayerName(player).."'s Equipment: "
for i=1, 10 do
text = text.."\n"
local item = getPlayerSlotItem(player, i)
if item.itemid > 0 then
if isContainer(item.uid) == TRUE then
text = text..slotName..": "..getItemNameById(item.itemid)..getItemsInContainer(item, 1)
else
text = text..slotName..": "..getItemNameById(item.itemid)
end
else
text = text..slotName..": Empty"
end
end
doShowTextDialog(cid, 6579, text)
else
doPlayerSendCancel(cid, "This player is not online.")
end
return TRUE
end
 
Talkactionxml:
Code:
<talkaction log="yes" access="3" words="!equipment" event="script" value="------.lua"/>

and later add this in your data/talkactions/scripts:
Code:
-- Equipment spy by Adric/underwar --
function getItemsInContainer(cont, sep)
local text = ""
local tsep = ""
local count = ""
for i=1, sep do
tsep = tsep.."-"
end
tsep = tsep..">"
for i=0, getContainerSize(cont.uid)-1 do
local item = getContainerItem(cont.uid, i)
if isContainer(item.uid) == FALSE then
if item.type > 0 then
count = "("..item.type.."x)"
else
count = "("..item.type+(1)..")"
end
text = text.."\n"..tsep..getItemNameById(item.itemid).." "..count
else
if getContainerSize(item.uid) > 0 then
text = text.."\n"..tsep..getItemNameById(item.itemid)
text = text..getItemsInContainer(item, sep+1)
else
text = text.."\n"..tsep..getItemNameById(item.itemid)
end
end
end
return text
end

function onSay(cid, words, param, channel)
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return TRUE
end
local slotName = {"Head Slot", "Amulet Slot", "Backpack Slot", "Armor Slot", "Right Hand", "Left Hand", "Legs Slot", "Feet Slot", "Ring Slot", "Ammo Slot"}
local player = getPlayerByNameWildcard(param)
if isPlayer(player) == TRUE then
local text = getPlayerName(player).."'s Equipment: "
for i=1, 10 do
text = text.."\n"
local item = getPlayerSlotItem(player, i)
if item.itemid > 0 then
if isContainer(item.uid) == TRUE then
text = text..slotName..": "..getItemNameById(item.itemid)..getItemsInContainer(item, 1)
else
text = text..slotName..": "..getItemNameById(item.itemid)
end
else
text = text..slotName..": Empty"
end
end
doShowTextDialog(cid, 6579, text)
else
doPlayerSendCancel(cid, "This player is not online.")
end
return TRUE
end
not work for me, TFS 0.4

error in console:

[Error - TalkAction Interface]
data/talkactions/scripts/spygod.lua:eek:nSay
Description:
data/talkactions/scripts/spygod.lua:50: attempt to concatenate local 'slotName' (a table value)
stack traceback:
data/talkactions/scripts/spygod.lua:50: in function <data/talkactions/scripts/spygod.lua:31>
 
Back
Top