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

Addon Doll in TFS 1.0

Felipe Monteiro

Webmaster
Joined
Feb 27, 2009
Messages
460
Reaction score
59
Location
Brasil
My addon doll and my mount doll talkactions doesnt work in tfs 1.0, and i have no idea what is wrong, because it doesnt show any error on console. If someone can help me..

Addon Doll
Code:
function onSay(cid, words, param)
    local femaleOutfits = {
        ["citizen"]={136},
        ["hunter"]={137},
        ["mage"]={138},
        ["knight"]={139},
        ["noblewoman"]={140},
        ["summoner"]={141},
        ["warrior"]={142},
        ["barbarian"]={147},
        ["druid"]={148},
        ["wizard"]={149},
        ["oriental"]={150},
        ["pirate"]={155},
        ["assassin"]={156},
        ["beggar"]={157},
        ["shaman"]={158},
        ["norsewoman"]={252},
        ["nightmare"]={269},
        ["jester"]={270},
        ["brotherhood"]={279},
        ["demonhunter"]={288},
        ["yalaharian"]={324},
        ["warmaster"]={336},
        ["wayfarer"]={366},
        ["afflicted"]={431},
        ["elementalist"]={433},
        ["deepling"]={464},
        ["insectoid"]={466},
        ["red baron"]={471},
        ["crystal warlord"]={513},
        ["soil guardian"]={514},
        ["demon"]={542}
}
    local maleOutfits = {
        ["citizen"]={128},
        ["hunter"]={129},
        ["mage"]={130},
        ["knight"]={131},
        ["nobleman"]={132},
        ["summoner"]={133},
        ["warrior"]={134},
        ["barbarian"]={143},
        ["druid"]={144},
        ["wizard"]={145},
        ["oriental"]={146},
        ["pirate"]={151},
        ["assassin"]={152},
        ["beggar"]={153},
        ["shaman"]={154},
        ["norsewoman"]={251},
        ["nightmare"]={268},
        ["jester"]={273},
        ["brotherhood"]={278},
        ["demonhunter"]={289},
        ["yalaharian"]={325},
        ["warmaster"]={335},
        ["wayfarer"]={367},
        ["afflicted"]={430},
        ["elementalist"]={432},
        ["deepling"]={463},
        ["insectoid"]={465},
        ["red baron"]={472},
        ["crystal warlord"]={512},
        ["soil guardian"]={516},
        ["demon"]={541}
}
    local msg = {"Digite novamente, algo está errado!", "Voce não tem addon doll!", "Tente outra vez, algo está errado!", "Seu Addon full foi adicionado!"}
    local param = string.lower(param)

    if(getPlayerItemCount(cid, 9693) > 0) then
        if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then
            doPlayerRemoveItem(cid, 9693, 1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4])
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
            if(getPlayerSex(cid) == 0)then
                doPlayerAddOutfit(cid, femaleOutfits[param][1], 3)
            else
                doPlayerAddOutfit(cid, maleOutfits[param][1], 3)
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2])
    end
end

Mount Doll
Code:
function onSay(cid, words, param)

local mounts = {
["widow queen"] = {price = 0, id = 1},
["racing bird"] = {price = 0, id = 2},
["war bear"] = {price = 0, id = 3},
["black sheep"] = {price = 0, id = 4},
["midnight panther"] = {price = 0, id = 5},
["draptor"] = {price = 0, id = 6},
["titanica"] = {price = 0, id = 7},
["tin lizzard"] = {price = 0, id = 8},
["blazebringer"] = {price = 0, id = 9},
["rapid boar"] = {price = 0, id = 10},
["stampor"] = {price = 0, id = 11},
["undead cavebear"] = {price = 0, id = 12},
["donkey"] = {price = 0, id = 13},
["tiger slug"] = {price = 0, id = 14},
["uniwheel"] = {price = 0, id = 15},
["crystal wolf"] = {price = 0, id = 16},
["war horse"] = {price = 0, id = 17},
["kingly deer"] = {price = 0, id = 18},
["tamed panda"] = {price = 0, id = 19},
["dromedary"] = {price = 0, id = 20},
["scorpion king"] = {price = 0, id = 21},
["fire war horse"] = {price = 0, id = 23},
["shadow draptor"] = {price = 0, id = 24},
["lady bug"] = {price = 0, id = 27},
["manta ray"] = {price = 0, id = 28},
["ironblight"] = {price = 0, id = 29},
["magma crawler"] = {price = 0, id = 30},
["dragonling"] = {price = 0, id = 31},
["gnarlhound"] = {price = 0, id = 32},
["red manta"] = {price = 0, id = 33},
["mechanical bird"] = {price = 0, id = 34},
["water buffalo"] = {price = 0, id = 35},
["armoured scorpion"] = {price = 0, id = 36},
["armoured dragonling"] = {price = 0, id = 37},
["armoured cavebear"] = {price = 0, id = 38},
["the hellgrip"] = {price = 0, id = 39}
}

local msg = {"Você pode escolher qualquer montaria do servidor! basta olhar elas no nosso site!!", "Voce nao tem Mountdoll..", "Algo errado..", "Mount conquistado com susseso!.","Voce ja tem este mount"}
local param = string.lower(param)
local t = mounts[param]

    if(getPlayerItemCount(cid, 13030) > 0) then
        if(param ~= "" and t) then
            if t and not getPlayerMount(cid, t.id) then
            doPlayerRemoveItem(cid, 13030, 1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4])
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
            doPlayerAddMount(cid, t.id)
            else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[5])
            end
        else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
        end
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2])
    end
end

- - - Updated - - -

BUMP :x

- - - Updated - - -

I know tha error is in

Code:
if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then

But how do work it on tfs 1.0?

- - - Updated - - -

Someone ? BUMP
 
Yes, when i just use !addon (without to insert the addon) it says that something is wrong, but when i use !addon citizen (or any other) it doesnt says nothing.
I think that error is in the second verification..

Code:
if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then

I hope u can help me. Thanks anyway


My talkactions
Code:
<talkaction words="!addon" script="addondoll.lua"/>

bump
 
Last edited by a moderator:
difference between 0.3+ and 1.0:
0.3+: /command param
1.0: /command "param
and I needed it so I wrote it myself long time before
try these:
Code:
function onSay(cid, words, param, channel)
if getPlayerAccess(cid) > 0 then
looktypes = {128, 136, 129, 137, 130, 138, 131, 139, 132, 140, 133, 141, 134, 142, 143, 147, 144, 148, 145, 149, 146, 150, 151, 155, 152, 156, 153, 157, 154, 158, 251, 252, 268, 269, 273, 270, 278, 279, 289, 288, 325, 324, 335, 336, 366, 367, 328, 329, 430, 431, 432, 433, 463, 464, 465, 466, 471, 472, 512, 513, 514, 516, 541, 542}
numbers = {"0", "1", "2", "3", " 0", " 1", " 2", " 3"}
if(not param) then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Gives player ability to wear all addons, example: /addons \"Player Name")
end

   local pid = getPlayerByName(param)
   if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
     return true
   end
   for i = 1, #looktypes do
   doPlayerAddOutfit(pid, looktypes[i], 3)
   end
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " received his addons.")
   doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "[Server]: One of server administrators allowed you to use all outfits and addons.")
   return true
else
return false
end
end

Code:
function onSay(cid, words, param, channel)
if getPlayerAccess(cid) > 0 then
   local pid = 0
   if(param == '') then
     pid = getCreatureTarget(cid)
     if(pid == 0) then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unlocks all mounts for certain player. Usage: /mounts \"Player Name")
       return true
     end
   else
     pid = getPlayerByName(param)
   end

   if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
     return true
   end
   for i = 1, 47 do
  doPlayerAddMount(pid, i)
  end
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been mounted.")
   doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "[Server]: One of server administrators allowed you to use all mounts.")
   return true
else
return false
end
end
 
Code:
local config = {
    ['citizen'] = { male = 128, female = 136 },
    ['hunter'] = { male = 129, female = 137 },
    ['mage'] = { male = 130, female = 141 },
    ['knight'] = { male = 131, female = 139 },
    ['summoner'] = { male = 133, female = 138 },
    ['warrior'] = { male = 134, female = 142 },
    ['barbarian'] = { male = 147, female = 143 },
    ['druid'] = { male = 148, female = 144 },
    ['wizard'] = { male = 149, female = 145 },
    ['oriental'] = { male = 150, female = 146 },
    ['pirate'] = { male = 151, female = 155 },
    ['assassin'] = { male = 152, female = 156 },
    ['beggar'] = { male = 153, female = 157 },
    ['shaman'] = { male = 154, female = 158 },
    ['norseman'] = { male = 251, female = 252 },
    ['nightmare'] = { male = 268, female = 269 },
    ['jester'] = { male = 273, female = 270 },
    ['brotherhood'] = { male = 278, female = 279 },
    ['demonhunter'] = { male = 289, female = 288 },
    ['yalaharian'] = { male = 325, female = 324 },
    ['warmaster'] = { male = 335, female = 336 },
    ['wayfarer'] = { male = 367, female = 366 },
    ['afflicted'] = { male = 430, female = 431 },
    ['elementalist'] = { male = 432, female = 433 },
    ['deepling'] = { male = 463, female = 464 },
    ['insectoid'] = { male = 465, female = 466 },
    ['crystal warlord'] = { male = 512, female = 513 },
    ['soil guardian'] = { male = 516, female = 514 },
    ['demon'] = { male = 541, female = 542 },
    ['cave explorer'] = { male = 574, female = 575 },
    ['dream warden'] = { male = 577, female = 578 }
}

function onSay(cid, words, param)
    local targetOutfit = config[param:lower()]
    if not targetOutfit then
        return false
    end

    local player = Player(cid)
    if player:getSex() == 0 then
        if param == 'mage' then
            targetOutfit.female, targetOutfit.male = 138, 133
        elseif param == 'summoner' then
            targetOutfit.female, targetOutfit.male = 141, 130
        end
    end

    if player:hasOutfit(player:getSex() == 0 and targetOutfit.female or targetOutfit.male, 3) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have already obtained the ' .. param .. ' addons.')
        return false
    end

    if not player:removeItem(8982, 1) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need an addon doll.')
        return false
    end

    player:addOutfitAddon(targetOutfit.female, 3)
    player:addOutfitAddon(targetOutfit.male, 3)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have received the ' .. param .. ' addons!')
    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
    return false
end
 
Back
Top