Blade33711
Member
Hi everyone! I'm using tfs 0.4
I need a help. How to make the function also work with npc?
bump
bump
bump
I need a help. How to make the function also work with npc?
C++:
int32_t LuaInterface::luaDoStartTrade(lua_State* L)
{
ScriptEnviroment* env = getEnv();
Item* item = env->getItemByUID(popNumber(L));
if(!item)
{
errorEx(getError(LUA_ERROR_ITEM_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
Player* target = env->getPlayerByUID(popNumber(L));
Player* player = env->getPlayerByUID(popNumber(L));
if(!player || !target)
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
if(g_game.internalStartTrade(player, target, item))
{
lua_pushboolean(L, true);
return 1;
}
return 1;
}
bump
bump
bump
Last edited by a moderator: