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

Fix PLx

MartyX

I'm renewing
Joined
Jun 6, 2007
Messages
1,240
Solutions
3
Reaction score
170
Location
El Grullo
GitHub
mattyx14
Command no finished TFS 0.4
Code:
local g = getMountInfo
local table = {
    [g(1)['name']:lower()] = {1, 13307},
    [g(2)['name']:lower()] = {2, 13298},
    [g(3)['name']:lower()] = {3, 5907},
    [g(4)['name']:lower()] = {4, 13295},
    [g(5)['name']:lower()] = {5, 13293},
    [g(6)['name']:lower()] = {6, 13294},
    [g(7)['name']:lower()] = {7, 13305},
    [g(8)['name']:lower()] = {8, 13292},
    [g(9)['name']:lower()] = {9, 12318},
    [g(10)['name']:lower()] = {10, 13247},
    [g(11)['name']:lower()] = {11, 12300},
    [g(12)['name']:lower()] = {12, 13291}
}

function onSay(cid, words, param, channel)

    if isInArray({'help','mount','mounts'},param:lower()) then
        local i = ''
        for m, n in pairs(table) do
            i = i .. '[' .. n[1] .. '] '
        end
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You can choose from these mounts: ' .. i)
    end

    local t = table[param:lower()]
    if not t then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Invalid mount name, use !mount help for more info.')
    end

    if getPlayerMount(cid, t[1]) then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You already have this mount.')
    end

    if getPlayerItemCount(cid, t[2]) == 0 then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You need a ' .. getItemNameById(t[2]) .. ' in order to obtain that mount.')
    end

    doPlayerAddMount(cid, t[1])
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You\'ve got the ' .. getMountInfo(t[1])['name'] .. ' mount! +' .. getMountInfo(t[1]).speed .. ' speed bonus.')
    return true
end
 
Back
Top