• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved TFS 1.2 /reload

undead mage

Active Member
Joined
Mar 25, 2012
Messages
364
Solutions
2
Reaction score
47
Location
Amsterdam
Well the /reload script for tfs 1.2 isn't working for me it gives me this error:
Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/reload.lua:OnSay
data/talkactions/scripts/reload.lua:36: attempt to call field 'isStrIn' (a nil value)
stack traceback:
               [C]: in function 'isStrIn'
               data/talkactions/scripts/reload.lua:36: in function <data/talkactions/scripts/reload.lua:27>

This is the script:
Code:
local reloadInfo = {
    {RELOAD_ACTIONS, "actions", "action"},
    {RELOAD_CHAT, "chat", "channels"},
    {RELOAD_CONFIG, "config", "configuration"},
    {RELOAD_CREATUREEVENTS, "creatureevents", "creature events", "creaturescripts", "creature scripts", "creatureevent", "creature event", "creature script", "creaturescript"},
    {RELOAD_GAMESERVERS, "gameservers", "game servers", "servers"},
    {RELOAD_GLOBALEVENTS, "globalevents", "global events", "globalevent", "global event"},
    {RELOAD_GROUPS, "groups", "playergroups", "group"},
    {RELOAD_HIGHSCORES, "highscores", "scores", "highscore", "score"},
    {RELOAD_HOUSEPRICES, "houseprices", "house prices", "prices"},
    {RELOAD_ITEMS, "items", "item"},
    {RELOAD_MONSTERS, "monsters", "monster"},
    {RELOAD_MOVEEVENTS, "moveevents", "move events", "movements", "move", "movement"},
    {RELOAD_NPCS, "npcs", "npc"},
    {RELOAD_OUTFITS, "outfits", "outfit"},
    {RELOAD_QUESTS, "quests", "quest"},
    {RELOAD_RAIDS, "raids", "raid"},
    {RELOAD_SPELLS, "spells", "spell"},
    {RELOAD_STAGES, "stages", "experience"},
    {RELOAD_TALKACTIONS, "talkactions", "talk actions", "talk", "commands", "talkaction", "talk action"},
    {RELOAD_VOCATIONS, "vocations", "vocation"},
    {RELOAD_WEAPONS, "weapons", "weapon"},
    {RELOAD_MODS, "mods", "modifications"},
    {RELOAD_ALL, "all", "everything"}
}

function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end

    param = param:lower()
    local str = "Reload type not found."
    for _, v in ipairs(reloadInfo) do
        if(table.isStrIn(param, v)) then
            doReloadInfo(v[1], cid)
            str = "Reloading " .. v[2] .. "..."
            break
        end
    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
    return true
end




also the save script isn't working either for me I dont know if it's supposed to only save a char or the whole server but I was looking for the script to save the whole server. This is the script:
Code:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    if return = true
    then
        saveServer()
    end
    return false
end
 
sorry
Code:
table.contains = function (txt, str)
    for i, v in pairs(str) do
        if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then
            return true
        end
    end
return false
end
 
sorry
Code:
table.contains = function (txt, str)
    for i, v in pairs(str) do
        if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then
            return true
        end
    end
return false
end

so it will be like this?
Code:
function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end

table.contains = function (txt, str)
    for i, v in pairs(str) do
        if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then
            return true
        end
    end
return false
end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
    return true
end
 
sorry
Code:
table.contains = function (txt, str)
    for i, v in pairs(str) do
        if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then
            return true
        end
    end
return false
end

Add that function in global.lua.

Still getting errors
256hd9j.jpg
 
Back
Top