int32_t LuaScriptInterface::luaGetPlayersByAccountId(lua_State* L)
{
//getPlayersByAccountId(accId)
PlayerVector players = g_game.getPlayersByAccount(popNumber(L));
ScriptEnviroment* env = getEnv();
[B][COLOR="Red"]PlayerVector::iterator it = players.begin();[/COLOR][/B]
lua_newtable(L);
[B][COLOR="Red"]for(uint32_t i = 1; it != players.end(); ++it, ++i)[/COLOR][/B]
{
lua_pushnumber(L, i);
lua_pushnumber(L, env->addThing(*it));
pushTable(L);
}
return 1;
}