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

debug when use a talkaction

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
hii, eeh i have this script that gives you a detail of the things that player X has, like helmet, legs...
but when i use it it gives me a debug, here is the script >.<

LUA:
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)"
            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+2)
            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, "Necesitas poner un nombre.")
        return TRUE
    end
    local slotName = {"Cabeza", "Amuleto", "Mochila", "Armadura", "Mano Derecha", "Mano Izquierda", "Piernas", "Pies", "Anillo", "Arrow Slot"}
    local player = getPlayerByNameWildcard(param)
    if isPlayer(player) == TRUE then
        local text = getPlayerName(player).."'s Equip: "   
        for i=1, 10 do
            text = text.."\n\n"
            local item = getPlayerSlotItem(player, i)
            if item.itemid > 0 then
                if isContainer(item.uid) == TRUE then
                    text = text..slotName[i]..": "..getItemNameById(item.itemid)..getItemsInContainer(item, 1)
                else
                    text = text..slotName[i]..": "..getItemNameById(item.itemid)
                end
            else
                text = text..slotName[i]..": Vacio"
            end
        end
        doShowTextDialog(cid, 6579, text)
    else
        doPlayerSendCancel(cid, "Este jugador no esta conectado.")
    end
 return TRUE
end


ooh and in client assertions doesn't appear the error :/!!

plzzz help, is the only way to know if players gets strange items :C or doner items

ooh and i just realized that the debug assertion is only with one (maybe more) player, but it works in other players :S
 
Back
Top