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

Lua function getPlayerByAccountNumber(acc)

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,618
Solutions
6
Reaction score
537
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
Can someone give me the full explanation of this function?
Like, what are the values? getPlayerByAccountNumber(acc).
Also, what does it do?
How it work?

Code:
function getPlayerByAccountNumber(acc)
	players = getPlayersByAccountNumber(acc)
	if #players == 0 then
		return 0
	end
	return players[1]
end
 
Well, it returns a table with the players uid in a certain account. And like any table to get it's size use the # sign before
it.
 
Well, it returns a table with the players uid in a certain account. And like any table to get it's size use the # sign before
it.

It actually doesn't return a table, but just single uid of player (first found on the list). :p

It uses getPlayersByAccountNumber function, which scans through players that are currently logged in game, and got same account id. Not useful in most cases, unless you got onePlayerOnlinePerAccount disabled.

but how to set a storage value to all players in determined account using this function ?

Can't be done, cause the function you posted just checks for players that are currently online. Mass editing storage values for whole account can be done only directly by quering database.
 
Back
Top