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

How to use getPlayersByAccountId(accountNumber)?

igorbr

New Member
Joined
Jan 9, 2008
Messages
34
Reaction score
0
Hello guys!
I want to learn how to use getPlayersByAccountId(accountNumber):confused:

somebody can help me?
Thanks for all.
 
Code:
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;
}
Online only.
 
Back
Top