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

Lua Mount seller Error

Nokturno

Not a human
Joined
Aug 7, 2009
Messages
606
Solutions
2
Reaction score
422
hELLO PEOPLE, I GOT this problem , i spected u can help me with this ...







Code:
local table = {
    ["Widow Queen"] = {price = 330000, id = 1},
    ["Mule"] = {price = 10000, id = 13},
    ["War Bear"] = {price = 330000, id = 3},
    ["Black Sheep"] = {price = 10000, id = 4},
    ["war horse"] = {price = 330000, id = 17},
    ["Kingly Deer"] = {price = 330000, id = 18},
    ["Titanica"] = {price = 330000, id = 7},
    ["Tin Lizzard"] = {price = 330000, id = 8},
    ["Dromedary"] = {price = 330000, id = 20},
    ["Rapid Boar"] = {price = 330000, id = 10},
    ["Stampor"] = {price = 330000, id = 11},
    ["Undead Cavebear"] = {price = 330000, id = 12}
}
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)           npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)          npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                  npcHandler:onThink()                    end

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
     if table[msg] then
      local t = table[msg]
      talkState[talkUser] = 1
       if getPlayerPremiumDays(cid) >= 1 then
        if not getPlayerMount(cid, t.id) then
         if doPlayerRemoveMoney(cid, t.cena) then
          doPlayerAddMount(cid, t.id)
          selfSay("You lost "..t.price.." gp! for mount!", cid)
          talkState[talkUser] = 0
         else
          selfSay("Sorry, you do not have enough money!", cid)
          talkState[talkUser] = 0
         end
        else
         selfSay("You already have this mount!", cid)
         talkState[talkUser] = 0
        end
       else
        selfSay("You must be Premium!", cid)
        talkState[talkUser] = 0
       end
    else
    selfSay('What? Please told me a correct name of mount!', cid)
    talkState[talkUser] = 0
   end
   return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Tell him what he can use then?

Check in your sources luascript.cpp for "mount", don't know what you're using :p
Luascript.cpp doesn't include mounts, those are found in mounts.cpp, and I didn't find anything there.
Also, what should I tell him to use if the function itself doesn't exist?
 
Yes, if you'r using an 8.7 version, then yes.
It needs the "mount" function and some others that are only able to use on 8.7 libs / version
 
Back
Top