Example:
luascript.cpp
After the line: lua_register(m_luaState, "doPlayerJoinParty", LuaInterface::luaDoPlayerJoinParty);
ADD:
After the function: int32_t LuaInterface::luaDoPlayerJoinParty(lua_State* L) ADD:
luascript.h
After the line: static int32_t luaDoPlayerJoinParty(lua_State* L);
ADD:
Enjoy.
Code:
doPlayerLeaveParty(cid)
luascript.cpp
After the line: lua_register(m_luaState, "doPlayerJoinParty", LuaInterface::luaDoPlayerJoinParty);
ADD:
Code:
//doPlayerLeaveParty(cid)
lua_register(m_luaState, "doPlayerLeaveParty", LuaInterface::luaDoPlayerLeaveParty);
Code:
int32_t LuaInterface::luaDoPlayerLeaveParty(lua_State* L) //lifeline feature
{
//doPlayerLeaveParty(cid)
ScriptEnviroment* env = getEnv();
Player* player = env->getPlayerByUID(popNumber(L));
if(!player)
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
}
g_game.playerLeaveParty(player->getID());
lua_pushboolean(L, true);
return 1;
}
After the line: static int32_t luaDoPlayerJoinParty(lua_State* L);
ADD:
Code:
static int32_t luaDoPlayerLeaveParty(lua_State* L); //lifeline feature
Enjoy.