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

Mount doll?

vingo

Active Member
Joined
Oct 27, 2012
Messages
464
Reaction score
43
Is there any possibility to make a talkaction that when you have a specific item(doll) you can say "!mount slug" and you will get tigerslug doll for TFS 1.0?


I currently have this
PHP:
function isIn(list)
local status
for key, value in pairs(list) do
if key == param then
return key, value
end
end
end

--you need to add the mounts and id's
--separate each entry with comma
local mounts = {
slug = 1
}
local item_id = 5785 --w/e item you are using

function onSay(cid, words, param)
if isIn(mounts) and doPlayerRemoveItem(cid,item_id,1) then
doPlayerAddMount(cid, value)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "That mount doesn't exist or you do not have the required item.")
end
return
end
 
The function
Code:
doPlayerAddMount
dont work with name only with MountID and i don't have idea to check the id of the name.

# EDITED:

You can to put all ids in one table in script;
 
Code:
local t = {
    -- ["param"] = {{itemid, count}, mountId, "mountName"}
    ["slug"] = {{5785, 1}, 14, "Tiger Slug"}
}

function onSay(cid, words, param)
    local player = Player(cid)
    local param = string.lower(param)
    local v = t[param]
    if param ~= "" and v then
        if not player:hasMount(v[2]) then
            local itemType = ItemType(v[1][1])
            if player:getItemCount(v[1][1]) >= v[1][2] then
                player:removeItem(v[1][1], v[1][2])
                player:addMount(v[2])
                player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Congratulations, you've obtained the %s!", v[3]))
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You need %s %s to obtain this mount!", (itemType:isStackable() and v[1][2] or itemType:getArticle() ~= "" and itemType:getArticle() or ""), (v[1][2] == 1 and itemType:getName() or itemType:getPluralName())))
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have this mount!")
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Command requires GOOD param!")
    end
    return false
end
 
EDIT: 2 minutes too late :D

Just add the mount ID and the name it should have from here
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mounts>
   <mount id="1" clientid="368" name="Widow Queen" speed="20" premium="yes" />
   <mount id="2" clientid="369" name="Racing Bird" speed="20" premium="yes" />
   <mount id="3" clientid="370" name="War Bear" speed="20" premium="yes" />
   <mount id="4" clientid="371" name="Black Sheep" speed="20" premium="yes" />
   <mount id="5" clientid="372" name="Midnight Panther" speed="20" premium="yes" />
   <mount id="6" clientid="373" name="Draptor" speed="20" premium="yes" />
   <mount id="7" clientid="374" name="Titanica" speed="20" premium="yes" />
   <mount id="8" clientid="375" name="Tin Lizzard" speed="20" premium="yes" />
   <mount id="9" clientid="376" name="Blazebringer" speed="20" premium="yes" />
   <mount id="10" clientid="377" name="Rapid Boar" speed="20" premium="yes" />
   <mount id="11" clientid="378" name="Stampor" speed="20" premium="yes" />
   <mount id="12" clientid="379" name="Undead Cavebear" speed="20" premium="yes" />
   <mount id="13" clientid="387" name="Donkey" speed="20" premium="yes" />
   <mount id="14" clientid="388" name="Tiger Slug" speed="20" premium="yes" />
   <mount id="15" clientid="389" name="Uniwheel" speed="20" premium="yes" />
   <mount id="16" clientid="390" name="Crystal Wolf" speed="20" premium="yes" />
   <mount id="17" clientid="392" name="Brown War Horse" speed="20" premium="yes" />
   <mount id="18" clientid="401" name="Kingly Deer" speed="20" premium="yes" />
   <mount id="19" clientid="402" name="Tamed Panda" speed="20" premium="yes" />
   <mount id="20" clientid="405" name="Dromedary" speed="20" premium="yes" />
   <mount id="21" clientid="406" name="King Scorpion" speed="20" premium="yes" />
   <mount id="22" clientid="421" name="Rented Horse" speed="20" premium="no" />
   <mount id="23" clientid="426" name="Armoured War Horse" speed="20" premium="yes" />
   <mount id="24" clientid="427" name="Shadow Draptor" speed="20" premium="yes" />
   <mount id="25" clientid="437" name="Rented Horse" speed="20" premium="no" />
   <mount id="26" clientid="438" name="Rented Horse" speed="20" premium="no" />
   <mount id="27" clientid="447" name="Ladybug" speed="20" premium="yes" />
   <mount id="28" clientid="450" name="Manta" speed="20" premium="yes" />
   <mount id="29" clientid="502" name="Ironblight" speed="20" premium="yes" />
   <mount id="30" clientid="503" name="Magma Crawler" speed="20" premium="yes" />
   <mount id="31" clientid="506" name="Dragonling" speed="20" premium="yes" />
   <mount id="32" clientid="515" name="Gnarlhound" speed="20" premium="yes" />
   <mount id="33" clientid="521" name="Crimson Ray" speed="20" premium="yes" />
   <mount id="34" clientid="522" name="Steelbeak" speed="20" premium="yes" />
   <mount id="35" clientid="526" name="Water Buffalo" speed="20" premium="yes" />
   <mount id="36" clientid="546" name="Armoured Scorpion" speed="20" premium="yes" />
   <mount id="37" clientid="547" name="Armoured Dragonling" speed="20" premium="yes" />
   <mount id="38" clientid="548" name="Armoured Cavebear" speed="20" premium="yes" />
   <mount id="39" clientid="559" name="The Hellgrip" speed="20" premium="yes" />
   <mount id="40" clientid="571" name="Lion" speed="20" premium="yes" />
   <mount id="41" clientid="572" name="Golden Lion" speed="20" premium="yes" />
   <mount id="42" clientid="580" name="Shock Head" speed="20" premium="yes" />
</mounts>
 
EDIT: 2 minutes too late :D

Just add the mount ID and the name it should have from here
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mounts>
   <mount id="1" clientid="368" name="Widow Queen" speed="20" premium="yes" />
   <mount id="2" clientid="369" name="Racing Bird" speed="20" premium="yes" />
   <mount id="3" clientid="370" name="War Bear" speed="20" premium="yes" />
   <mount id="4" clientid="371" name="Black Sheep" speed="20" premium="yes" />
   <mount id="5" clientid="372" name="Midnight Panther" speed="20" premium="yes" />
   <mount id="6" clientid="373" name="Draptor" speed="20" premium="yes" />
   <mount id="7" clientid="374" name="Titanica" speed="20" premium="yes" />
   <mount id="8" clientid="375" name="Tin Lizzard" speed="20" premium="yes" />
   <mount id="9" clientid="376" name="Blazebringer" speed="20" premium="yes" />
   <mount id="10" clientid="377" name="Rapid Boar" speed="20" premium="yes" />
   <mount id="11" clientid="378" name="Stampor" speed="20" premium="yes" />
   <mount id="12" clientid="379" name="Undead Cavebear" speed="20" premium="yes" />
   <mount id="13" clientid="387" name="Donkey" speed="20" premium="yes" />
   <mount id="14" clientid="388" name="Tiger Slug" speed="20" premium="yes" />
   <mount id="15" clientid="389" name="Uniwheel" speed="20" premium="yes" />
   <mount id="16" clientid="390" name="Crystal Wolf" speed="20" premium="yes" />
   <mount id="17" clientid="392" name="Brown War Horse" speed="20" premium="yes" />
   <mount id="18" clientid="401" name="Kingly Deer" speed="20" premium="yes" />
   <mount id="19" clientid="402" name="Tamed Panda" speed="20" premium="yes" />
   <mount id="20" clientid="405" name="Dromedary" speed="20" premium="yes" />
   <mount id="21" clientid="406" name="King Scorpion" speed="20" premium="yes" />
   <mount id="22" clientid="421" name="Rented Horse" speed="20" premium="no" />
   <mount id="23" clientid="426" name="Armoured War Horse" speed="20" premium="yes" />
   <mount id="24" clientid="427" name="Shadow Draptor" speed="20" premium="yes" />
   <mount id="25" clientid="437" name="Rented Horse" speed="20" premium="no" />
   <mount id="26" clientid="438" name="Rented Horse" speed="20" premium="no" />
   <mount id="27" clientid="447" name="Ladybug" speed="20" premium="yes" />
   <mount id="28" clientid="450" name="Manta" speed="20" premium="yes" />
   <mount id="29" clientid="502" name="Ironblight" speed="20" premium="yes" />
   <mount id="30" clientid="503" name="Magma Crawler" speed="20" premium="yes" />
   <mount id="31" clientid="506" name="Dragonling" speed="20" premium="yes" />
   <mount id="32" clientid="515" name="Gnarlhound" speed="20" premium="yes" />
   <mount id="33" clientid="521" name="Crimson Ray" speed="20" premium="yes" />
   <mount id="34" clientid="522" name="Steelbeak" speed="20" premium="yes" />
   <mount id="35" clientid="526" name="Water Buffalo" speed="20" premium="yes" />
   <mount id="36" clientid="546" name="Armoured Scorpion" speed="20" premium="yes" />
   <mount id="37" clientid="547" name="Armoured Dragonling" speed="20" premium="yes" />
   <mount id="38" clientid="548" name="Armoured Cavebear" speed="20" premium="yes" />
   <mount id="39" clientid="559" name="The Hellgrip" speed="20" premium="yes" />
   <mount id="40" clientid="571" name="Lion" speed="20" premium="yes" />
   <mount id="41" clientid="572" name="Golden Lion" speed="20" premium="yes" />
   <mount id="42" clientid="580" name="Shock Head" speed="20" premium="yes" />
</mounts>



When I use !mount draptor it just says it out in default, but only saying !mount says "you need to write a mount name" or smthing
 
You're probably missing separator=" "
Code:
<talkaction words="!mount" separator=" " script="mountdoll.lua"/>
 
Back
Top