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

Problem with the /reload command TFS 1.2

Lubinho Fit

Member
Joined
May 10, 2017
Messages
37
Reaction score
8
I can't use the /reload if i just type /reload i get "Reload type not found." if i put a reload type like "/reload all" nothing happens just this error.

Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/reload.lua:eek:nSay
data/talkactions/scripts/reload.lua:76: attempt to call field 'reload' (a nil value)
stack traceback:
[C]: in function 'reload'
data/talkactions/scripts/reload.lua:76: in function <data/talkactions/scripts/reload.lua:56>


I have accountType set to 5 in the database and character groupID to 3

accountType.PNG groupID.PNG

My groups.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<groups>
    <group id="1" name="player"     flags="0"            access="0" maxdepotitems="0" maxvipentries="0" />
    <group id="2" name="gamemaster" flags="137438953471" access="1" maxdepotitems="0" maxvipentries="200" />
    <group id="3" name="god"        flags="272730398714" access="1" maxdepotitems="0" maxvipentries="200" />
</groups>


My reload.lua
Lua:
local reloadTypes = {
    ["all"] = { targetType = RELOAD_TYPE_ALL, name = "all" },

    ["action"] = { targetType = RELOAD_TYPE_ACTIONS, name = "actions" },
    ["actions"] = { targetType = RELOAD_TYPE_ACTIONS, name = "actions" },

    ["chat"] = { targetType = RELOAD_TYPE_CHAT, name = "chatchannels" },
    ["channel"] = { targetType = RELOAD_TYPE_CHAT, name = "chatchannels" },
    ["chatchannels"] = { targetType = RELOAD_TYPE_CHAT, name = "chatchannels" },

    ["config"] = { targetType = RELOAD_TYPE_CONFIG, name = "config" },
    ["configuration"] = { targetType = RELOAD_TYPE_CONFIG, name = "config" },

    ["creaturescript"] = { targetType = RELOAD_TYPE_CREATURESCRIPTS, name = "creature scripts" },
    ["creaturescripts"] = { targetType = RELOAD_TYPE_CREATURESCRIPTS, name = "creature scripts" },

    ["events"] = { targetType = RELOAD_TYPE_EVENTS, name = "events" },

    ["global"] = { targetType = RELOAD_TYPE_GLOBAL, name = "global.lua" },

    ["globalevent"] = { targetType = RELOAD_TYPE_GLOBALEVENTS, name = "globalevents" },
    ["globalevents"] = { targetType = RELOAD_TYPE_GLOBALEVENTS, name = "globalevents" },

    ["items"] = { targetType = RELOAD_TYPE_ITEMS, name = "items" },

    ["monster"] = { targetType = RELOAD_TYPE_MONSTERS, name = "monsters" },
    ["monsters"] = { targetType = RELOAD_TYPE_MONSTERS, name = "monsters" },

    ["mount"] = { targetType = RELOAD_TYPE_MOUNTS, name = "mounts" },
    ["mounts"] = { targetType = RELOAD_TYPE_MOUNTS, name = "mounts" },

    ["move"] = { targetType = RELOAD_TYPE_MOVEMENTS, name = "movements" },
    ["movement"] = { targetType = RELOAD_TYPE_MOVEMENTS, name = "movements" },
    ["movements"] = { targetType = RELOAD_TYPE_MOVEMENTS, name = "movements" },

    ["npc"] = { targetType = RELOAD_TYPE_NPCS, name = "npcs" },
    ["npcs"] = { targetType = RELOAD_TYPE_NPCS, name = "npcs" },

    ["quest"] = { targetType = RELOAD_TYPE_QUESTS, name = "quests" },
    ["quests"] = { targetType = RELOAD_TYPE_QUESTS, name = "quests" },

    ["raid"] = { targetType = RELOAD_TYPE_RAIDS, name = "raids" },
    ["raids"] = { targetType = RELOAD_TYPE_RAIDS, name = "raids" },

    ["spell"] = { targetType = RELOAD_TYPE_SPELLS, name = "spells" },
    ["spells"] = { targetType = RELOAD_TYPE_SPELLS, name = "spells" },

    ["talk"] = { targetType = RELOAD_TYPE_TALKACTIONS, name = "talk actions" },
    ["talkaction"] = { targetType = RELOAD_TYPE_TALKACTIONS, name = "talk actions" },
    ["talkactions"] = { targetType = RELOAD_TYPE_TALKACTIONS, name = "talk actions" },

    ["weapon"] = { targetType = RELOAD_TYPE_WEAPONS, name = "weapons" },
    ["weapons"] = { targetType = RELOAD_TYPE_WEAPONS, name = "weapons" }
}

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

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

    logCommand(player, words, param)

    local reloadType = reloadTypes[param and param:lower()]
    if not reloadType then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Reload type not found.")
        return false
    end

    Game.reload(reloadType.targetType)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("Reloaded %s.", reloadType.name))
    return false
end
 
Solution
there's no such thing as a scripted /reload command in 1.2
it was moved out of sources into talkactions in 1.3, not 1.2
so you're overwriting the source-made /reload with your version that won't work, because Game.reload doesn't exist.
remove your command and /reload will work just fine.
Is your source code updated?
Try to just call
Lua:
Game.reload(RELOAD_TYPE_WEAPONS)
 
remove your command and /reload will work just fine.

Hi,

I did not understand this part. The reload don't work for me, I already took it from the talkactions and even then it does nothing. How do I know which version of my TFS? I simply compiled it for Ubuntu and it's working. But I wanted to know about /reload. Please
 
Hi,

I did not understand this part. The reload don't work for me, I already took it from the talkactions and even then it does nothing. How do I know which version of my TFS? I simply compiled it for Ubuntu and it's working. But I wanted to know about /reload. Please
i explained exactly what happens when you use a talkaction, it overwrites the source-made reload function which makes your reload not work
simply remove the talkaction and the /reload written in c++ will work
if it still doesn't work you need to update your account type in database to 5
 
i explained exactly what happens when you use a talkaction, it overwrites the source-made reload function which makes your reload not work
simply remove the talkaction and the /reload written in c++ will work
if it still doesn't work you need to update your account type in database to 5

Hi, thanks.
Could you explain how to remove it? The files below?

xgSy8eVYScCu-Wy_LjH9bQ.jpeg

lkApB8DhQ7iWO-KFnslcrw.jpeg


Another thing, the compilation made by the tutorial of TFS in Linux, ends in which version?
And yeah, i also have changed type account for 5.

Thanks.
 
i'm not talking about anything you need to remove in your sources, the problem is you have a reload talkaction in your data folder
data/talkactions/???.lua
 
i'm not talking about anything you need to remove in your sources, the problem is you have a reload talkaction in your data folder
data/talkactions/???.lua

I have this files..
lAIpiMBJR9aINF7FWpuCtw.jpeg


And I remove this in file talkactions.xml
GPL2n01AQUGfBcaIfoRrHw.jpeg


And /reload in game dont work.
 
Should this command work? This nor any other works.
GhxY0VEwS7C1nBOmOOvohA.jpeg
are you using tfs 1.2 or 1.3?
look at the top of your console when you start your server, it tells you
reload is built in source in 1.2 so you can't have a reload talkaction
but in 1.3 reload is made by a talkaction script
 
then your account type isn't 5 or you aren't a staff character
make sure you're updating account type/group id while you're offline because it won't save if you're online
if it still doesn't work then i have no clue, the reason above is the only other thing that could be causing it to just not work
 
Back
Top