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

[C++] Get Creaty Storage Value

gabrielbsales

New Member
Joined
Dec 13, 2010
Messages
35
Reaction score
0
PS: In Title is CREATURE '-'
How to do it? i need one function wich get certain storage value.
I try it:
Code:
int32_t LuaScriptInterface::luaGetCreatureSetNick(lua_State* L)
{
    //getCreatureSetNick(cid)
    ScriptEnviroment* env = getEnv();
    std::string strValue;
    Creature* creature;
if(creature = env->getCreatureByUID(popNumber(L))){
Monster* monster = (Monster*)creature;
    if(monster->getStorage(16767, strValue))
    {
            lua_pushstring(16767, strValue);
    }else
    lua_pushnumber(16767, -1);
}
    return 1;
}

But return this error:
Code:
cannot convert `std::string' to `const char*' for argument `2' to `void lua_pushstring(lua_State*, const char*)'
and it
Code:
invalid conversion from `int' to `lua_State*'
Someone can help me? Thanks
 
Back
Top Bottom