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

Compiling Storage in channel.xml

lucashgas

New Member
Joined
Jul 5, 2008
Messages
35
Reaction score
0
Location
Brazil
I'm trying to put one storage in "channel.xml" for example:
The "HELP" channel appears to be the only player has "101012" storage, otherwise it will not appear .. equal to the channel "Trade" in rook .. when you choose your vocation.
In short ->
Code:
<channel id="7" name="Duel-Rookgaard" level="20" muted="120"
<vocation id="0">
<storage="101012"/>

My friend was helping me, I am beginner. The idea of ​​this code is
Code:
int32_t LuaInterface::luaDoPlayerSendChannelsDialog(lua_State* L)
{
        //doPlayerSendChannelsDialog(uid)
        ScriptEnviroment* env = getEnv();
        if(Player* player = env->getPlayerByUID(popNumber(L)))
        {
                player->sendChannelsDialog();
                lua_pushboolean(L, true);

              {
                createTable(L, i);
                setField(L, "id", (*it)->getId());
                setField(L, "name", (*it)->getName());

                setField(L, "flags", (*it)->getFlags());
                setField(L, "level", (*it)->getLevel());
                setField(L, "access", (*it)->getAccess());
                pushTable(L);
              }
        }
        else
        {
                errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                lua_pushboolean(L, false);
        }

        return 1;

Sem título.jpg
#fail ^^

Thank you!
 
Last edited:
Is that the whole script you have?

in luascrip.cpp
Code:
lua_register(m_luaState, "doPlayerSendChannelsDialog", LuaInterface::luaDoPlayerSendChannelsDialog);
and my script in the main post.

and in luascript.h
Code:
static int32_t luaDoPlayerSendChannelsDialog(lua_State* L);

this is all my changes... What you say?
 
Your script is bad. You can't do it in luascript.cpp, because this file add lua functions to lua interface.
You should create this features in chat.cpp and chat.h.
 

Similar threads

Replies
2
Views
592
Back
Top