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

Help i need remove all mount form all player? db?? game?? help

Solution
I wound up using a talkaction:
XML:
<talkaction words="/rmounts" separator=" " script="removemounts.lua" />

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    local target
    if param == '' then
        target = player:getTarget()
        if not target then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Locks all mounts for certain player. Usage: /mounts <player name>')
            return false
        end
    else
        target = Player(param)
    end

    if not target then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Player ' .. param .. ' is not currently online.')
        return false
    end

    if target:getAccountType() >...
In the end, threads like these wind up as the TOP RESULT in google searches for similar issue.

I really hate when i see these, can the thread not be deleted?
 
I wound up using a talkaction:
XML:
<talkaction words="/rmounts" separator=" " script="removemounts.lua" />

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    local target
    if param == '' then
        target = player:getTarget()
        if not target then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Locks all mounts for certain player. Usage: /mounts <player name>')
            return false
        end
    else
        target = Player(param)
    end

    if not target then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Player ' .. param .. ' is not currently online.')
        return false
    end

    if target:getAccountType() > player:getAccountType() then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Cannot perform action.')
        return false
    end

    for i = 1, 47 do
        target:removeMount(i)
    end

    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'All mounts removed for: ' .. target:getName())
    target:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '[Server] All mounts removed.')
    return false
end

Now this google result can actually serve someone in the future. The meat of it was changing this function in the script that GIVES mounts...

Lua:
]target:addMount(i)

-- INSTEAD OF

target:removeMount(i)
 
Solution
Doesn't really answer the main threads issue though.
The talkaction removes it from a specific player, where the question asks how to remove everybody's mounts.

Is it not stored in the database somewhere?
 
Back
Top