• 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 Player secure mode

beliar34

Member
Joined
Feb 28, 2012
Messages
307
Solutions
7
Reaction score
11
Code:
luascript.cpp: In static member function 'static int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State*)':
luascript.cpp:10402:36: error: 'getEnv' was not declared in this scope
     ScriptEnviroment* env = getEnv();
                                    ^
luascript.cpp:10406:52: error: 'getError' was not declared in this scope
         errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                                    ^
luascript.cpp:10406:53: error: 'errorEx' was not declared in this scope
         errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                                     ^
luascript.cpp: In static member function 'static int32_t LuaScriptInterface::luaGetPlayerFightMode(lua_State*)':
luascript.cpp:10418:36: error: 'getEnv' was not declared in this scope
     ScriptEnviroment* env = getEnv();
                                    ^
luascript.cpp:10422:52: error: 'getError' was not declared in this scope
         errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                                    ^
luascript.cpp:10422:53: error: 'errorEx' was not declared in this scope
         errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                                     ^
Makefile:556: recipe for target 'luascript.o' failed

When trying to compile with : https://otland.net/threads/getplayersecuremode-cid-getplayerfightmode-cid.128276/

and i added to luascripts.cpp also
Code:
    lua_register(m_luaState, "PlayerSecureMode", LuaScriptInterface::luaGetPlayerSecureMode);

    lua_register(m_luaState, "PlayerFightMode", LuaScriptInterface::luaGetPlayerFightMode);
and to lusascripts.h
Code:
        static int32_t luaGetPlayerSecureMode(lua_State* L);
        static int32_t luaGetPlayerFightMode(lua_State* L);
 
If it is 1.2 there is no function getSecureMode, there is however hasSecureMode but you would have to return a boolean rather than a number.
Also there is no getPlayerByUID but there is getThingByUID.
This also needs to be changed
Code:
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
to
Code:
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
 
Sorry I am not familiar with that code or do not have the source for it. :(
But men you already helped me ! i changed a errorex and i got less errors i got only now
Code:
       ^
luascript.cpp: In static member function 'static int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State*)':
luascript.cpp:10402:36: error: 'getEnv' was not declared in this scope
     ScriptEnviroment* env = getEnv();
                                    ^
luascript.cpp: In static member function 'static int32_t LuaScriptInterface::luaGetPlayerFightMode(lua_State*)':
luascript.cpp:10418:36: error: 'getEnv' was not declared in this scope
     ScriptEnviroment* env = getEnv();
 
But men you already helped me ! i changed a errorex and i got less errors i got only now
Code:
       ^
luascript.cpp: In static member function 'static int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State*)':
luascript.cpp:10402:36: error: 'getEnv' was not declared in this scope
     ScriptEnviroment* env = getEnv();
                                    ^
luascript.cpp: In static member function 'static int32_t LuaScriptInterface::luaGetPlayerFightMode(lua_State*)':
luascript.cpp:10418:36: error: 'getEnv' was not declared in this scope
     ScriptEnviroment* env = getEnv();
Sorry can't help you without the sources :(
 
check it:
Code:
int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State* L)
{
    //getPlayerSecureMode(cid)
    ScriptEnviroment* env = getScriptEnv();
    Player* player = env->getPlayerByUID((uint32_t)popNumber(L));
    if(!player)
    {
        reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
        lua_pushboolean(L, false);
    }
    else
        lua_pushnumber(L, player->getSecureMode());

    return 1;
}
 
i got this error now, i tried with no edited luascript and still this error but i already compiled tfs 4-5 times lol
Code:
`boost::system::system_category()'
 

Similar threads

Replies
2
Views
594
Back
Top Bottom