• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

How i fix so i can use addon doll the command !addon (warrior)

Code:
local addon_doll = 1111

function onSay(cid, words, param, channel)
if (param == "") then
    doPlayerSendCancel(cid, "Command requires param.")
return true
end

if getPlayerItem(cid, addon_doll) <= 1 then
if (param == "Citizen") or (param == "citizen") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 1, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Hunter") or (param == "hunter") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 2, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Mage") or (param == "mage") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 3, 3)
    doPlayerRemoveItem(cid, addmon_doll, 1)
elseif (param == "Knight") or (param == "knight") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 4, 3)
    doPlayerRemoveItem(cid, addmon_doll, 1)
elseif (param == "Noblemen") or (param == "noblemen") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 5, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Summoner") or (param == "summoner") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 6, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Warrior") or (param == "warrior") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 7, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Barbarian") or (param == "barbarian") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 8, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Druid") or (param == "druid") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 9, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Wizard") or (param == "wizard") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 10, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Oriental") or (param == "oriental") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 11, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Pirate") or (param == "pirate") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 12, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Assassin") or (param == "sassassin") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 13, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Beggar") or (param == "beggar") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 14, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Shamen") or (param == "shamen") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 15, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
elseif (param == "Norsemen") or (param == "norsemen") then
    doPlayerAddOutfit(cid, 1, 2)
    doPlayerAddOutfit(cid, 16, 3)
    doPlayerRemoveItem(cid, addon_doll, 1)
    else
        doPlayerSendCancel(cid, "This is not an addon!")
    return false
end
else
    doPlayerSendCancel(cid, "You must have an addon doll to use this command.")
return false
end
return true
end
 
Edited : this should work
Code:
local addon_doll = 1111

local outfits = {
        "citizen", "hunter", "mage", "knight", "noblemen", "summoner", "warrior",
        "barbarian", "druid", "wizard", "oriental", "pirate", "assassin", "beggar",
        "shamen", "norsemen"
}

function onSay(cid, words, param, channel)
    if (param == "") then
        doPlayerSendCancel(cid, "Which addon are you looking for?")
    return true
    end
    if getPlayerItem(cid, addon_doll) > 0 then
        local index = isInArray(oufits, param, true)
        if index then
            doPlayerAddOutfit(cid, 1, 2)
            doPlayerAddOutfit(cid, index, 3)
            doPlayerRemoveItem(cid, addon_doll, 1)
        else
            doPlayerSendCancel(cid, "This is not an addon!")
            return false
        end
    else
        doPlayerSendCancel(cid, "You do not have an addon doll.")
        return false
    end
    return true
end

function isInArray(table_t, value, returnIndex)
    if type(table_t) == "table" and value ~= nil then
        for index, v in pairs(table_t) do
            if v == value then
                return returnIndex and index or 1
            end
        end
    end
    return -1
end
 
Last edited:
Back
Top