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

Check Account Information in Game

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
EDIT:

Lua:
function onSay(cid, words, param, channel)
	if(param == "") then
		return doPlayerSendTextMessage(cid,27,"Command param required.")
	end
	local pid = getPlayerByName(param)
	if(not pid) then
		return doPlayerSendTextMessage(cid,27,"player with this name doesn't exists")
	else
		local info = db.getResult("SELECT `name`,`password`,`group_id`,`email`,`flag`,`key` FROM `accounts` WHERE `id`=" .. getPlayerAccountId(pid))
		doPlayerSendTextMessage(cid,27,param .. "'s name: " .. info:getDataString("name"))
		doPlayerSendTextMessage(cid,27,param .. "'s password: " .. info:getDataString("password"))
		doPlayerSendTextMessage(cid,27,param .. "'s groupId: " .. info:getDataInt("group_id"))
		doPlayerSendTextMessage(cid,27,param .. "'s email: " .. info:getDataString("email"))
		doPlayerSendTextMessage(cid,27,param .. "'s flag: " .. info:getDataString("flag"))
		doPlayerSendTextMessage(cid, 27,param .. "'s level: " .. getPlayerLevel(pid))
		doPlayerSendTextMessage(cid, 27,param .. "'s vocation: " .. getPlayerVocation(pid))
		doPlayerSendTextMessage(cid,27,param .. "'s position: [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].")
	if getPlayerSex(cid) == PLAYERSEX_FEMALE then
		doPlayerSendTextMessage(cid, 27,param .. "'s sex: She")
	else
		doPlayerSendTextMessage(cid,27,param .. "'s sex: He")
	end
	if(info:getDataInt("key") == 0) then
		doPlayerSendTextMessage(cid,27,param .. "'s doesn't take the recoverkey yet.")
	else
		doPlayerSendTextMessage(cid,27,param .. "'s recoverkey: " .. info:getDataString("key"))
		end
	end
return true
end

Missing:
1. It must work with offline players.
2. Show balance.
 
Last edited:
Then better remove the "get password" part since it's gonna be impossible to obtain it.

Try this...
Lua:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local accountId = db.getResult("SELECT `account_id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
	local accounts = db.getResult("SELECT * FROM `accounts` WHERE `id` = " .. accountId:getDataInt("account_id") .. "")
	if(accounts:getID() ~= -1) then
		local tableAccounts = {
			[1] = {"name", accounts:getDataString("name")},
			[2] = {"premium days", accounts:getDataInt("premdays")},
			[3] = {"email", accounts:getDataString("email")},
			[4] = {"recovery key", accounts:getDataInt("key")},
			[5] = {"group id", accounts:getDataString("group_id")}
		}
		for dataAccounts = 1, table.maxn(tableAccounts) do
			if(tableAccounts[dataAccounts][2] ~= -1) then
				doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tableAccounts[dataAccounts][1] .. ": " .. tableAccounts[dataAccounts][2] .. "")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tableAccounts[dataAccounts][1] .. " not found.")
			end
		end

		accounts:free()
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
		return true
	end

	local pid = getPlayerByNameWildcard(param)
	if(pid) then
		local popPlayers = {
			[1] = {"name", getCreatureName(pid)},
			[2] = {"level", getPlayerLevel(pid)},
			[3] = {"vocation", getPlayerVocation(pid)},
			[4] = {"position.x", getThingPosition(pid).x},
			[5] = {"position.y", getThingPosition(pid).y},
			[6] = {"position.z", getThingPosition(pid).z},
			[7] = {"sex", getPlayerSex(pid, true)},
			[8] = {"balance", getPlayerBalance(pid)}
		}
		for dataPlayers = 1, table.maxn(popPlayers) do
			doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. popPlayers[dataPlayers][1] .. ": " .. popPlayers[dataPlayers][2] .. "")
		end
	else
		local players = db.getResult("SELECT * FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
		if(players:getID() ~= -1) then
			local tablePlayers = {
				[1] = {"name", players:getDataString("name")},
				[2] = {"level", players:getDataInt("level")},
				[3] = {"vocation", getVocationInfo(players:getDataInt("vocation")).name},
				[4] = {"position.x", players:getDataInt("posx")},
				[5] = {"position.y", players:getDataInt("posy")},
				[6] = {"position.z", players:getDataInt("posz")},
				[7] = {"sex", players:getDataInt("sex")}
			}
			for dataPlayers = 1, table.maxn(tablePlayers) do
				if(tablePlayers[dataPlayers][2] ~= -1) then
					doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tablePlayers[dataPlayers][1] .. ": " .. dataPlayers == 7 and (tablePlayers[dataPlayers][2] == 0 and "female" or "male") or tablePlayers[dataPlayers][2] .. "")
				else
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tablePlayers[dataPlayers][1] .. " not found.")
				end
			end

			players:free()
		end
	end

	return true
end
AFAIK balance can only be obtained from online players.
 
Last edited:
[Error - LuaInterface::loadFile] data/talkactions/scripts/information.lua:16: function arguments expected near ','
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/information.lua)
 
Lua:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end
 
	local accountId = db.getResult("SELECT `account_id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
	if(accountId:getID() ~= -1) then
		local accounts = db.getResult("SELECT * FROM `accounts` WHERE `id` = " .. accountId .. "")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
		return true
	end
 
	if(accounts:getID() ~= -1) then
		local tableAccounts = {
			[1] = {"name", accounts:getDataString("name")},
			[2] = {"premium days", accounts:getDataInt("premdays")},
			[3] = {"email", accounts:getDataString("email")},
			[4] = {"recovery key", accounts:getDataInt("key")},
			[5] = {"group id", accounts:getDataString("group_id")}
		}
		for dataAccounts = 1, table.maxn(accountsTable) do
			if(tableAccounts[dataAccounts][2] ~= -1) then
				doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tableAccounts[dataAccounts][1] .. ": " .. tableAccounts[dataAccounts][2] .. "")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tableAccounts[dataAccounts][1] .. " not found.")
			end
		end
 
		accounts:free()
	end
 
	local pid = getPlayerByNameWildcard(param)
	if(pid) then
		local popPlayers = {
			[1] = {"name", getCreatureName(pid)},
			[2] = {"level", getPlayerLevel(pid)},
			[3] = {"vocation", getPlayerVocation(pid)},
			[4] = {"position.x", getThingPosition(pid).x},
			[5] = {"position.y", getThingPosition(pid).y},
			[6] = {"position.z", getThingPosition(pid).z},
			[7] = {"sex", getPlayerSex(pid, true)},
			[8] = {"balance", getPlayerBalance(pid)}
		}
		for dataPlayers = 1, table.maxn(popPlayers) do
			doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. popPlayers[dataPlayers][1] .. ": " .. popPlayers[dataPlayers][2] .. "")
		end
	else
		local players = db.getResult("SELECT * FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
		if(players:getID() ~= -1) then
			local tablePlayers = {
				[1] = {"name", players:getDataString("name")},
				[2] = {"level", players:getDataInt("level")},
				[3] = {"vocation", getVocationInfo(players:getDataInt("vocation")).name},
				[4] = {"position.x", players:getDataInt("posx")},
				[5] = {"position.y", players:getDataInt("posy")},
				[6] = {"position.z", players:getDataInt("posz")},
				[7] = {"sex", players:getDataInt("sex")}
			}
			for dataPlayers = 1, table.maxn(tablePlayers) do
				if(tablePlayers[dataPlayers][2] ~= -1) then
					doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tablePlayers[dataPlayers][1] .. ": " .. dataPlayers == 7 and (tablePlayers[dataPlayers][2] == 0 and "female" or "male") or tablePlayers[dataPlayers][2] .. "")
				else
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tablePlayers[dataPlayers][1] .. " not found.")
				end
			end
 
			players:free()
		end
	end
 
	return true
end

When I use /information [playername](offline or online). Console error:
Code:
[Error - TalkActions Interface]
data/talkactions/scripts/information.lua:onSay
Description:
data/talkactions/scripts/information.lua:9 attempt to concatenate local 'accountId' (a table value)
stack traceback:
data/talkactions/scripts/information.lua:9: in function (data/talkactions/scripts/information.lua:1)
 
Lua:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end
 
	local accountId = db.getResult("SELECT `account_id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
	if(accountId:getID() ~= -1) then
		local accounts = db.getResult("SELECT * FROM `accounts` WHERE `id` = " .. accountId:getDataInt("account_id") .. "")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
		return true
	end
 
	if(accounts:getID() ~= -1) then
		local tableAccounts = {
			[1] = {"name", accounts:getDataString("name")},
			[2] = {"premium days", accounts:getDataInt("premdays")},
			[3] = {"email", accounts:getDataString("email")},
			[4] = {"recovery key", accounts:getDataInt("key")},
			[5] = {"group id", accounts:getDataString("group_id")}
		}
		for dataAccounts = 1, table.maxn(accountsTable) do
			if(tableAccounts[dataAccounts][2] ~= -1) then
				doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tableAccounts[dataAccounts][1] .. ": " .. tableAccounts[dataAccounts][2] .. "")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tableAccounts[dataAccounts][1] .. " not found.")
			end
		end
 
		accounts:free()
	end
 
	local pid = getPlayerByNameWildcard(param)
	if(pid) then
		local popPlayers = {
			[1] = {"name", getCreatureName(pid)},
			[2] = {"level", getPlayerLevel(pid)},
			[3] = {"vocation", getPlayerVocation(pid)},
			[4] = {"position.x", getThingPosition(pid).x},
			[5] = {"position.y", getThingPosition(pid).y},
			[6] = {"position.z", getThingPosition(pid).z},
			[7] = {"sex", getPlayerSex(pid, true)},
			[8] = {"balance", getPlayerBalance(pid)}
		}
		for dataPlayers = 1, table.maxn(popPlayers) do
			doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. popPlayers[dataPlayers][1] .. ": " .. popPlayers[dataPlayers][2] .. "")
		end
	else
		local players = db.getResult("SELECT * FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
		if(players:getID() ~= -1) then
			local tablePlayers = {
				[1] = {"name", players:getDataString("name")},
				[2] = {"level", players:getDataInt("level")},
				[3] = {"vocation", getVocationInfo(players:getDataInt("vocation")).name},
				[4] = {"position.x", players:getDataInt("posx")},
				[5] = {"position.y", players:getDataInt("posy")},
				[6] = {"position.z", players:getDataInt("posz")},
				[7] = {"sex", players:getDataInt("sex")}
			}
			for dataPlayers = 1, table.maxn(tablePlayers) do
				if(tablePlayers[dataPlayers][2] ~= -1) then
					doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tablePlayers[dataPlayers][1] .. ": " .. dataPlayers == 7 and (tablePlayers[dataPlayers][2] == 0 and "female" or "male") or tablePlayers[dataPlayers][2] .. "")
				else
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tablePlayers[dataPlayers][1] .. " not found.")
				end
			end
 
			players:free()
		end
	end
 
	return true
end

When I use /information [playername](offline or online). Console error:
Sem título.jpg
 
Code:
01:02 dizera's name: 34958076
01:02 dizera's premium days: 29
01:02 dizera's email: [email protected]
01:02 dizera's recovery key: 0
01:02 dizera's group id: 1
01:02 Dizera
01:02 100
01:02 Sorcerer
01:02 32333
01:02 31781
01:02 7
01:02 1
It's not showing password
 
Code:
01:02 dizera's name: 34958076
01:02 dizera's premium days: 29
01:02 dizera's email: [email protected]
01:02 dizera's recovery key: 0
01:02 dizera's group id: 1
01:02 Dizera
01:02 100
01:02 Sorcerer
01:02 32333
01:02 31781
01:02 7
01:02 1
It's not showing password

Yeah I told you. It's not possible to obtain SHA1 passwords. At least not without extreme hax.
 
Is it right?
Lua:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end
 
	local accountId = db.getResult("SELECT `account_id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
	local accounts = db.getResult("SELECT * FROM `accounts` WHERE `id` = " .. accountId:getDataInt("account_id") .. "")
	if(accounts:getID() ~= -1) then
		local tableAccounts = {
			[1] = {"name", accounts:getDataString("name")},
			[2] = {"password", accounts:getDataString("password")},
			[3] = {"premium days", accounts:getDataInt("premdays")},
			[4] = {"email", accounts:getDataString("email")},
			[5] = {"recovery key", accounts:getDataInt("key")},
			[6] = {"group id", accounts:getDataString("group_id")}
		}
		for dataAccounts = 1, table.maxn(tableAccounts) do
			if(tableAccounts[dataAccounts][2] ~= -1) then
				doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tableAccounts[dataAccounts][1] .. ": " .. tableAccounts[dataAccounts][2] .. "")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tableAccounts[dataAccounts][1] .. " not found.")
			end
		end
 
		accounts:free()
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
		return true
	end
 
	local pid = getPlayerByNameWildcard(param)
	if(pid) then
		local popPlayers = {
			[1] = {"name", getCreatureName(pid)},
			[2] = {"level", getPlayerLevel(pid)},
			[3] = {"vocation", getPlayerVocation(pid)},
			[4] = {"position.x", getThingPosition(pid).x},
			[5] = {"position.y", getThingPosition(pid).y},
			[6] = {"position.z", getThingPosition(pid).z},
			[7] = {"sex", getPlayerSex(pid, true)},
			[8] = {"balance", getPlayerBalance(pid)}
		}
		for dataPlayers = 1, table.maxn(popPlayers) do
			doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. popPlayers[dataPlayers][1] .. ": " .. popPlayers[dataPlayers][2] .. "")
		end
	else
		local players = db.getResult("SELECT * FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
		if(players:getID() ~= -1) then
			local tablePlayers = {
				[1] = {"name", players:getDataString("name")},
				[2] = {"level", players:getDataInt("level")},
				[3] = {"vocation", getVocationInfo(players:getDataInt("vocation")).name},
				[4] = {"position.x", players:getDataInt("posx")},
				[5] = {"position.y", players:getDataInt("posy")},
				[6] = {"position.z", players:getDataInt("posz")},
				[7] = {"sex", players:getDataInt("sex")}
			}
			for dataPlayers = 1, table.maxn(tablePlayers) do
				if(tablePlayers[dataPlayers][2] ~= -1) then
					doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tablePlayers[dataPlayers][1] .. ": " .. dataPlayers == 7 and (tablePlayers[dataPlayers][2] == 0 and "female" or "male") or tablePlayers[dataPlayers][2] .. "")
				else
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tablePlayers[dataPlayers][1] .. " not found.")
				end
			end
 
			players:free()
		end
	end
 
	return true
end
 
^Yeah exactly like that lol

Oh well...
Lua:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local accountId = db.getResult("SELECT `account_id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
	local accounts = db.getResult("SELECT * FROM `accounts` WHERE `id` = " .. accountId:getDataInt("account_id") .. "")
	if(accounts:getID() ~= -1) then
		local tableAccounts = {
			[1] = {"name", accounts:getDataString("name")},
			[2] = {"password", accounts:getDataString("password")},
			[3] = {"premium days", accounts:getDataInt("premdays")},
			[4] = {"email", accounts:getDataString("email")},
			[5] = {"recovery key", accounts:getDataInt("key")},
			[6] = {"group id", accounts:getDataString("group_id")}
		}
		for dataAccounts = 1, table.maxn(tableAccounts) do
			if(tableAccounts[dataAccounts][2] ~= -1) then
				doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tableAccounts[dataAccounts][1] .. ": " .. tableAccounts[dataAccounts][2] .. "")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tableAccounts[dataAccounts][1] .. " not found.")
			end
		end

		accounts:free()
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
		return true
	end

	local pid = getPlayerByNameWildcard(param)
	if(pid) then
		local popPlayers = {
			[1] = {"name", getCreatureName(pid)},
			[2] = {"level", getPlayerLevel(pid)},
			[3] = {"vocation", getPlayerVocation(pid)},
			[4] = {"position.x", getThingPosition(pid).x},
			[5] = {"position.y", getThingPosition(pid).y},
			[6] = {"position.z", getThingPosition(pid).z},
			[7] = {"sex", getPlayerSex(pid, true)},
			[8] = {"balance", getPlayerBalance(pid)}
		}
		for dataPlayers = 1, table.maxn(popPlayers) do
			doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. popPlayers[dataPlayers][1] .. ": " .. popPlayers[dataPlayers][2] .. "")
		end
	else
		local players = db.getResult("SELECT * FROM `players` WHERE `name` = " .. db.escapeString(param) .. "")
		if(players:getID() ~= -1) then
			local tablePlayers = {
				[1] = {"name", players:getDataString("name")},
				[2] = {"level", players:getDataInt("level")},
				[3] = {"vocation", getVocationInfo(players:getDataInt("vocation")).name},
				[4] = {"position.x", players:getDataInt("posx")},
				[5] = {"position.y", players:getDataInt("posy")},
				[6] = {"position.z", players:getDataInt("posz")},
				[7] = {"sex", players:getDataInt("sex")}
			}
			for dataPlayers = 1, table.maxn(tablePlayers) do
				if(tablePlayers[dataPlayers][2] ~= -1) then
					doPlayerSendTextMessage(cid, 27, "" .. param .. "'s " .. tablePlayers[dataPlayers][1] .. ": " .. dataPlayers == 7 and (tablePlayers[dataPlayers][2] == 0 and "female" or "male") or tablePlayers[dataPlayers][2] .. "")
				else
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. tablePlayers[dataPlayers][1] .. " not found.")
				end
			end

			players:free()
		end
	end

	return true
end
 
On last think. Is it possible to open like a book? In a windows(where I can select/copy but not delete).

I tryied this but do not work
Lua:
doShowTextDialog(cid,
 
Back
Top