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

TalkAction Equipment Spy!

great idea.
so have a little problem items grouped or not only always shows as if it had (100) and not 1 as it should be.
redid the script is for you ae already arranged.

please i would like to ask your permission so I can post your script on another forum could be?
send pm to accept warning.

thanks.
-- Equipment spy by Azi [ersiu] --
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
 
It debugs for me too when I type like /eq Name with Space

EDIT; Debugging when I type like /eq NameWithoutSpace
too ;s

EDIT2; Not debugging when I make /eq OnMySelf
but on other people it debugs..

EDIT3; I need to be in screen when I say /eq Name with Space or /eq NameWithoutSpace, else I get debugged.

EDIT4; If you have a rune or a stack of gps before another item in your backpack every item after that will show like
plate armor
wooden shield
gold coin(79x)
mace(79x)
sword(79x)
crysal coin(44x)
zaoan armor(44x)
halberd(44x)
I use TFS 0.3.5pl1
 
Last edited:
I Tried This Script But It Dont Work Everytime I Try It On Any player It says This Person Is Not Online Including When I DO It On My Self
 
I test and work perfect for me.
I use change that line,

Lua:
doShowTextDialog(cid, 6579, text)

For..

Lua:
doPlayerPopupFYI(cid, text)

Is better to show equips..
more, if player has alot of itens that function not work. ;c

And, i do that,

Lua:
     ... end
doPlayerPopupFYI(cid, text) -- First open that if there some itens 
doShowTextDialog(cid, 6579, text) -- If have alot of itens open that line "too" and/or "only"
    else ... ~


I'ts work perfect. :cool:
Tnx, baby! :p
 
I test and work perfect for me.
I use change that line,

Lua:
doShowTextDialog(cid, 6579, text)

For..

Lua:
doPlayerPopupFYI(cid, text)

Is better to show equips..
more, if player has alot of itens that function not work. ;c

And, i do that,

Lua:
     ... end
doPlayerPopupFYI(cid, text) -- First open that if there some itens 
doShowTextDialog(cid, 6579, text) -- If have alot of itens open that line "too" and/or "only"
    else ... ~


I'ts work perfect. :cool:
Tnx, baby! :p

Yes but, if player have some much items, and the text in the Popup have too much lines, you will get a client debug.
 
This only worked for me in 0.3.6pl o_O W/e
PHP:
<talkaction log="yes" words="!equipment" acces="3" event="script" value="equipment.lua"/>
 
Lua:
     ... end
doPlayerPopupFYI(cid, text) -- First open that if there some itens 
doShowTextDialog(cid, 6579, text) -- If have alot of itens open that line "too" and/or "only"
    else ... ~
I'ts work perfect. :cool:
Tnx, baby! :p
You get's many client debug's i don't see big apperance when you have popup message or item text o ;
 
This only worked for me in 0.3.6pl o_O W/e
PHP:
<talkaction log="yes" words="!equipment" acces="3" event="script" value="equipment.lua"/>

small typo there:
Lua:
<talkaction log="yes" words="!equipment" access="3" event="script" value="equipment.lua"/>
you missed an S in "access" ;)
 
Back
Top