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

C++ luaDoChallengeCreature

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,683
Solutions
36
Reaction score
388
how i can use
fpp.maxTargetDist = 1;
fpp.fullPathSearch = true;
here
Code:
int32_t LuaInterface::luaDoChallengeCreature(lua_State* L)
{
    //doChallengeCreature(cid, target)
    ScriptEnviroment* env = getEnv();
    uint32_t targetCid = popNumber(L);

    Creature* creature = env->getCreatureByUID(popNumber(L));
    if(!creature)
    {
        errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
        lua_pushboolean(L, false);
        return 1;
    }

    Creature* target = env->getCreatureByUID(targetCid);
    if(!target)
    {
        errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
        lua_pushboolean(L, false);
        return 1;
    }

    target->challengeCreature(creature);
    lua_pushboolean(L, true);
    return 1;
}

when i do get this error
luascript.cpp `fpp' was not declared in this scope

0.4
 
Back
Top