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

Solved mount doll tfs 1.0

mimus

New Member
Joined
Mar 14, 2012
Messages
168
Reaction score
2
im using this mount doll but only worcks whith panda and widow mount can u helpme?


Code:
function onSay(cid, words, param)

   local table = {
    -- ["mount"] = {price = x, id = x},
      ["widow"] = {price = 0, id = 1},
      ["bird"] = {price = 0, id = 2},
      ["bear"] = {price = 0, id = 3},
      ["sheep"] = {price = 0, id = 4},
      ["panther"] = {price = 0, id = 5},
      ["draptor"] = {price = 0, id = 6},
      ["titanica"] = {price = 0, id = 7},
      ["lizzard"] = {price = 0, id = 8},
      ["blazebringer"] = {price = 0, id = 9},
      ["rapidBoar"] = {price = 0, id = 10},
      ["stampor"] = {price = 0, id = 11},
      ["undeadcavebear"] = {price = 0, id = 12},
      ["donkey"] = {price = 0, id = 13},
      ["slug"] = {price = 0, id = 14},
      ["uniwheel"] = {price = 0, id = 15},
      ["crystalwolf"] = {price = 0, id = 16},
      ["panda"] = {price = 0, id = 19},
      ["dromedary"] = {price = 0, id = 20},
      ["kingScorpion"] = {price = 0, id = 21}
    
   }

   local player, param = Player(cid), string.lower(param)
    local mountdoll_id = 9019 -- id do mount doll
   local t = table[param]
  
   if player:getItemCount(mountdoll_id) > 0 then
        if param ~= "" and t then
            if not player:hasMount(t.id) then 
            player:removeItem(mountdoll_id, 1)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "Sua mount foi adicionada!")
                Position(getThingPos(cid)):sendMagicEffect(CONST_ME_GIFT_WRAPS)
            player:addMount(t.id)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja tem esta mount.")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "Digite novamente, algo está errado!")
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce não tem um mount doll!")
    end
end
 
Check the ids and names, make sure you are saying the correct words.

And change getThingPos(cid) to player:getPosition()
 
the widows works and the name of the mount is white widow, the panda also works and none of the other on the list dosnt work, theres not error on console just say that the addon is not found
 
I edit your script ,look now.

Code:
function onSay(cid, words, param)

local mounts = {
["widow"] = {price = 0, id = 1},
["bird"] = {price = 0, id = 2},
["bear"] = {price = 0, id = 3},
["sheep"] = {price = 0, id = 4},
["panther"] = {price = 0, id = 5},
["draptor"] = {price = 0, id = 6},
["titanica"] = {price = 0, id = 7},
["lizzard"] = {price = 0, id = 8},
["blazebringer"] = {price = 0, id = 9},
["rapidboar"] = {price = 0, id = 10},
["stampor"] = {price = 0, id = 11},
["undeadcavebear"] = {price = 0, id = 12},
["donkey"] = {price = 0, id = 13},
["slug"] = {price = 0, id = 14},
["uniwheel"] = {price = 0, id = 15},
["crystalwolf"] = {price = 0, id = 16},
["panda"] = {price = 0, id = 19},
["dromedary"] = {price = 0, id = 20},
["kingscorpion"] = {price = 0, id = 21}
}

local mountdoll_id = 9019
local msg = {"Digite novamente, algo está errado!", "Voce não tem um mount doll!", "Algo errado..", "Sua mount foi adicionada!","Voce ja tem esta mount."}
local param = string.lower(param)
local t = mounts[param]

    if(getPlayerItemCount(cid, mountdoll_id) > 0) then
        if(param ~= "" and t) then
            if t and not getPlayerMount(cid, t.id) then
            doPlayerRemoveItem(cid, mountdoll_id, 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
 
Code:
function onSay(cid, words, param)
    local mounts = {
        ["widow"] = {id = 1},
        ["bird"] = {id = 2},
        ["bear"] = {id = 3},
        ["sheep"] = {id = 4},
        ["panther"] = {id = 5},
        ["draptor"] = {id = 6},
        ["titanica"] = {id = 7},
        ["lizzard"] = {id = 8},
        ["blazebringer"] = {id = 9},
        ["rapidboar"] = {id = 10},
        ["stampor"] = {id = 11},
        ["undeadcavebear"] = {id = 12},
        ["donkey"] = {id = 13},
        ["slug"] = {id = 14},
        ["uniwheel"] = {id = 15},
        ["crystalwolf"] = {id = 16},
        ["panda"] = {id = 19},
        ["dromedary"] = {id = 20},
        ["kingscorpion"] = {id = 21}
    }
   
    local p = Player(cid)
    if(p:getItemCount(9019) > 0) then
        local t = mounts[string.lower(param)]
        if(param ~= "" and t) then
            if(t and not p:hasMount(t.id)) then
                p:removeItem(9019, 1)
                p:sendTextMessage(MESSAGE_INFO_DESCR, "Sua mount foi adicionada!")
                p:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
                p:addMount(t.id)
            else
                p:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja tem esta mount.")
            end
        else
            p:sendTextMessage(MESSAGE_INFO_DESCR, "Digite novamente, algo está errado!")
        end
    else
        p:sendTextMessage(MESSAGE_INFO_DESCR, "Voce não tem um mount doll!")
    end
return true
end

Printer is right, why use the old system when you are running a tfs 1.0 server?! ;o
 
Back
Top